OperatorSegment.tsx 521 B

123456789101112131415161718
  1. import React, { FC } from 'react';
  2. import { SelectableValue } from '@grafana/data';
  3. import { Segment } from '@grafana/ui';
  4. interface Props {
  5. value: string;
  6. onChange: (item: SelectableValue<string>) => void;
  7. }
  8. const options = ['=', '!=', '<', '>', '=~', '!~'].map<SelectableValue<string>>((value) => ({
  9. label: value,
  10. value,
  11. }));
  12. export const OperatorSegment: FC<Props> = ({ value, onChange }) => {
  13. return <Segment className="query-segment-operator" value={value} options={options} onChange={onChange} />;
  14. };