import { memo, ChangeEvent, FormEvent } from 'react'; import { IntervalVariableModel, SelectableValue } from '@grafana/data'; import { IntervalVariableForm } from 'app/features/dashboard-scene/settings/variables/components/IntervalVariableForm'; import { VariableEditorProps } from '../editor/types'; export interface Props extends VariableEditorProps {} export const IntervalVariableEditor = memo(({ onPropChange, variable }: Props) => { const onAutoChange = (event: ChangeEvent) => { onPropChange({ propName: 'auto', propValue: event.target.checked, updateOptions: true, }); }; const onQueryBlur = (event: FormEvent) => { onPropChange({ propName: 'query', propValue: event.currentTarget.value, updateOptions: true, }); }; const onAutoCountChanged = (option: SelectableValue) => { onPropChange({ propName: 'auto_count', propValue: option.value, updateOptions: true, }); }; const onAutoMinChanged = (event: FormEvent) => { onPropChange({ propName: 'auto_min', propValue: event.currentTarget.value, updateOptions: true, }); }; return ( ); }); IntervalVariableEditor.displayName = 'IntervalVariableEditor';