import { Stack, Text, Group, SegmentedControl, rem } from '@mantine/core'; import { useMantineColorScheme, useComputedColorScheme } from '@mantine/core'; import { Sun, Moon, Monitor } from 'lucide-react'; export const AppearanceTab = () => { const { colorScheme, setColorScheme } = useMantineColorScheme(); const computedColorScheme = useComputedColorScheme('light', { getInitialValueInEffect: false, }); const isDark = computedColorScheme === 'dark'; return (
Theme Choose how the application should appear setColorScheme(value as 'light' | 'dark' | 'auto') } styles={(theme) => ({ indicator: { backgroundColor: isDark ? theme.colors.dark[5] : theme.colors.gray[2], border: `1px solid ${ isDark ? theme.colors.dark[4] : theme.colors.gray[4] }`, }, })} data={[ { label: ( Light ), value: 'light', }, { label: ( Dark ), value: 'dark', }, { label: ( System ), value: 'auto', }, ]} />
); };