Files
grafana/public/app/core/components/Layers/AddLayerButton.tsx
Nathan Marrs e07abd76c0 Canvas: refactor layer editor (#42562)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-12-02 15:54:45 -08:00

24 lines
535 B
TypeScript

import React from 'react';
import { ValuePicker } from '@grafana/ui';
import { SelectableValue } from '@grafana/data';
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}
/>
);
};