import React from 'react'; import { SelectableValue } from '@grafana/data'; import { EditorField } from '@grafana/experimental'; import { InlineField, Select } from '@grafana/ui'; import { VariableQueryType } from '../../types'; import { removeMarginBottom } from '../styles'; const LABEL_WIDTH = 20; interface VariableQueryFieldProps { onChange: (value: T) => void; options: SelectableValue[]; value: T | null; label: string; inputId?: string; allowCustomValue?: boolean; isLoading?: boolean; newFormStylingEnabled?: boolean; } export const VariableQueryField = ({ label, onChange, value, options, allowCustomValue = false, isLoading = false, inputId = label, newFormStylingEnabled, }: VariableQueryFieldProps) => { return newFormStylingEnabled ? ( onChange(value!)} options={options} isLoading={isLoading} inputId={inputId} /> ); };