Add dark mode option
This commit is contained in:
29
src/components/theme-selector.tsx
Normal file
29
src/components/theme-selector.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 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;
|
||||
Reference in New Issue
Block a user