grafana/public/app/features/dashboard/components/ShareModal/ThemePicker.tsx
Josh Hunt 5361efc225
I18n: Migrate to I18next (#55845)
* Switch from lingui from i18next

* Change lingui messages to i18next messages

* Change lingui messages to i18next messages (grafana-ui)

* Init i18n for tests
2022-10-06 16:34:04 +01:00

34 lines
890 B
TypeScript

import React from 'react';
import { SelectableValue } from '@grafana/data';
import { RadioButtonGroup, Field } from '@grafana/ui';
import { t } from 'app/core/internationalization';
interface Props {
selectedTheme: string;
onChange: (value: string) => void;
}
export const ThemePicker = ({ selectedTheme = 'current', onChange }: 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`)}>
<RadioButtonGroup options={themeOptions} value={selectedTheme} onChange={onChange} />
</Field>
);
};