import { Segmented, Tooltip } from 'antd'; import { BulbOutlined, MoonOutlined, DesktopOutlined } from '@ant-design/icons'; import { useThemeMode } from '../theme/useThemeMode'; import type { ThemeMode } from '../theme/themeStorage'; import type { ReactNode } from 'react'; interface ThemeSwitchProps { size?: 'small' | 'middle' | 'large'; block?: boolean; } const options: Array<{ value: ThemeMode; label: ReactNode }> = [ { value: 'light', label: ( ), }, { value: 'dark', label: ( ), }, { value: 'system', label: ( ), }, ]; export default function ThemeSwitch({ size = 'middle', block = false }: ThemeSwitchProps) { const { mode, setMode } = useThemeMode(); return ( setMode(value as ThemeMode)} options={options} block={block} /> ); }