grafana/public/app/core/components/Layers/AddLayerButton.tsx
2022-08-26 16:03:20 -05:00

24 lines
542 B
TypeScript

import React from 'react';
import { SelectableValue } from '@grafana/data';
import { ValuePicker } from '@grafana/ui';
export type AddLayerButtonProps = {
onChange: (sel: SelectableValue<string>) => void;
options: Array<SelectableValue<string>>;
label: string;
};
export const AddLayerButton = ({ onChange, options, label }: AddLayerButtonProps) => {
return (
<ValuePicker
icon="plus"
label={label}
variant="secondary"
options={options}
onChange={onChange}
isFullWidth={true}
/>
);
};