grafana/public/app/features/variables/adhoc/picker/OperatorSegment.tsx
Josh Hunt 06d78ea904
Dashboards: Disable variable pickers for snapshots (#52827)
* user essentials mob! 🔱

lastFile:public/app/features/variables/textbox/TextBoxVariablePicker.tsx

* user essentials mob! 🔱

* user essentials mob! 🔱

lastFile:public/app/features/variables/adhoc/picker/AdHocFilter.tsx

* finish up disabling variables in snapshots

* remove accident

* use theme.spacing instead of the v1 shim

Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: Leodegario Pasakdal <leodegario.pasakdal@grafana.com>
2022-07-29 16:29:55 +01:00

28 lines
617 B
TypeScript

import React, { FC } from 'react';
import { SelectableValue } from '@grafana/data';
import { Segment } from '@grafana/ui';
interface Props {
value: string;
onChange: (item: SelectableValue<string>) => void;
disabled?: boolean;
}
const options = ['=', '!=', '<', '>', '=~', '!~'].map<SelectableValue<string>>((value) => ({
label: value,
value,
}));
export const OperatorSegment: FC<Props> = ({ value, disabled, onChange }) => {
return (
<Segment
className="query-segment-operator"
value={value}
disabled={disabled}
options={options}
onChange={onChange}
/>
);
};