mirror of
https://github.com/lone-cloud/gerbil
synced 2026-06-03 09:33:10 -07:00
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
import { Stack, Text, Group, SegmentedControl, rem } from '@mantine/core';
|
|
import { Sun, Moon, Monitor } from 'lucide-react';
|
|
import { useTheme, type ThemeMode } from '@/contexts/ThemeContext';
|
|
|
|
export const AppearanceTab = () => {
|
|
const { themeMode, setThemeMode } = useTheme();
|
|
|
|
return (
|
|
<Stack gap="lg" h="100%">
|
|
<div>
|
|
<Text fw={500} mb="sm">
|
|
Theme
|
|
</Text>
|
|
<Text size="sm" c="dimmed" mb="md">
|
|
Choose how the application should appear
|
|
</Text>
|
|
<SegmentedControl
|
|
fullWidth
|
|
value={themeMode}
|
|
onChange={(value) => setThemeMode(value as ThemeMode)}
|
|
data={[
|
|
{
|
|
label: (
|
|
<Group gap="xs" justify="center">
|
|
<Sun style={{ width: rem(16), height: rem(16) }} />
|
|
<span>Light</span>
|
|
</Group>
|
|
),
|
|
value: 'light',
|
|
},
|
|
{
|
|
label: (
|
|
<Group gap="xs" justify="center">
|
|
<Moon style={{ width: rem(16), height: rem(16) }} />
|
|
<span>Dark</span>
|
|
</Group>
|
|
),
|
|
value: 'dark',
|
|
},
|
|
{
|
|
label: (
|
|
<Group gap="xs" justify="center">
|
|
<Monitor style={{ width: rem(16), height: rem(16) }} />
|
|
<span>System</span>
|
|
</Group>
|
|
),
|
|
value: 'system',
|
|
},
|
|
]}
|
|
/>
|
|
</div>
|
|
</Stack>
|
|
);
|
|
};
|