You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
691 B
20 lines
691 B
import React, { useCallback } from 'react';
|
|
import { GraphTresholdsStyleMode } from '@grafana/schema';
|
|
import { FieldOverrideEditorProps, SelectableValue } from '@grafana/data';
|
|
import { Select } from '@grafana/ui';
|
|
|
|
export const ThresholdsStyleEditor: React.FC<
|
|
FieldOverrideEditorProps<SelectableValue<{ mode: GraphTresholdsStyleMode }>, any>
|
|
> = ({ item, value, onChange, id }) => {
|
|
const onChangeCb = useCallback(
|
|
(v: SelectableValue<GraphTresholdsStyleMode>) => {
|
|
onChange({
|
|
mode: v.value,
|
|
});
|
|
},
|
|
[onChange]
|
|
);
|
|
return (
|
|
<Select inputId={id} menuShouldPortal value={value.mode} options={item.settings.options} onChange={onChangeCb} />
|
|
);
|
|
};
|
|
|