mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* 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>
28 lines
617 B
TypeScript
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}
|
|
/>
|
|
);
|
|
};
|