30 lines
856 B
TypeScript
30 lines
856 B
TypeScript
/**
|
|
* Theme Selector Component
|
|
*
|
|
* Provides UI for switching between light/dark/system theme modes.
|
|
* Uses shadcn/ui Select component.
|
|
*
|
|
* @author Andreas Weyer
|
|
* @license MIT
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select';
|
|
|
|
const ThemeSelector = ({ currentTheme, onThemeChange, t }: any) => {
|
|
return (
|
|
<Select value={currentTheme} onValueChange={onThemeChange}>
|
|
<SelectTrigger className="w-36">
|
|
<SelectValue />
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
<SelectItem value="light">{t('themeSelectorLight')}</SelectItem>
|
|
<SelectItem value="dark">{t('themeSelectorDark')}</SelectItem>
|
|
<SelectItem value="system">{t('themeSelectorSystem')}</SelectItem>
|
|
</SelectContent>
|
|
</Select>
|
|
);
|
|
};
|
|
|
|
export default ThemeSelector;
|