import React from 'react'; import { FieldOverrideEditorProps, SelectableValue } from '@grafana/data'; import { HorizontalGroup, RadioButtonGroup } from '@grafana/ui'; import { InputPrefix, NullsThresholdInput } from './NullsThresholdInput'; const DISCONNECT_OPTIONS: Array> = [ { label: 'Never', value: false, }, { label: 'Threshold', value: 3600000, // 1h }, ]; type Props = FieldOverrideEditorProps; export const InsertNullsEditor = ({ value, onChange, item }: Props) => { const isThreshold = typeof value === 'number'; DISCONNECT_OPTIONS[1].value = isThreshold ? value : 3600000; // 1h return ( {isThreshold && ( )} ); };