Files
grafana/public/app/plugins/datasource/cloud-monitoring/components/Fields.tsx
Andreas Christou d00ea685e6 CloudMonitoring: Use Field instead of InlineField (#75829)
* Use Field instead of InlineField

* Prettify
2023-10-04 15:45:26 +02:00

33 lines
675 B
TypeScript

import React from 'react';
import { SelectableValue } from '@grafana/data';
import { Field, Select } from '@grafana/ui';
interface VariableQueryFieldProps {
onChange: (value: string) => void;
options: SelectableValue[];
value: string;
label: string;
allowCustomValue?: boolean;
}
export const VariableQueryField = ({
label,
onChange,
value,
options,
allowCustomValue = false,
}: VariableQueryFieldProps) => {
return (
<Field label={label}>
<Select
width={25}
allowCustomValue={allowCustomValue}
value={value}
onChange={({ value }) => onChange(value!)}
options={options}
/>
</Field>
);
};