mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 21:32:14 +08:00

* i18n: removes useTranslate hook * chore: fix duplicate imports * chore: fix import sorting and hook dependencies
33 lines
909 B
TypeScript
33 lines
909 B
TypeScript
import { SelectableValue } from '@grafana/data';
|
|
import { t } from '@grafana/i18n';
|
|
import { RadioButtonGroup, Field } from '@grafana/ui';
|
|
|
|
interface Props {
|
|
selectedTheme: string;
|
|
onChange: (value: string) => void;
|
|
description?: string;
|
|
}
|
|
|
|
export const ThemePicker = ({ selectedTheme = 'current', onChange, description }: Props) => {
|
|
const themeOptions: Array<SelectableValue<string>> = [
|
|
{
|
|
label: t('share-modal.theme-picker.current', `Current`),
|
|
value: 'current',
|
|
},
|
|
{
|
|
label: t('share-modal.theme-picker.dark', `Dark`),
|
|
value: 'dark',
|
|
},
|
|
{
|
|
label: t('share-modal.theme-picker.light', `Light`),
|
|
value: 'light',
|
|
},
|
|
];
|
|
|
|
return (
|
|
<Field label={t('share-modal.theme-picker.field-name', `Theme`)} description={description}>
|
|
<RadioButtonGroup options={themeOptions} value={selectedTheme} onChange={onChange} />
|
|
</Field>
|
|
);
|
|
};
|