()
| 9 | } |
| 10 | |
| 11 | const ThemeSelector = () => { |
| 12 | const { t } = useTranslation(); |
| 13 | const settingStore = useSettingStore(); |
| 14 | const theme = settingStore.setting.theme; |
| 15 | |
| 16 | const themeItemList: ThemeItem[] = [ |
| 17 | { |
| 18 | value: "system", |
| 19 | label: t("setting.theme.system"), |
| 20 | }, |
| 21 | { |
| 22 | value: "light", |
| 23 | label: t("setting.theme.light"), |
| 24 | }, |
| 25 | { |
| 26 | value: "dark", |
| 27 | label: t("setting.theme.dark"), |
| 28 | }, |
| 29 | ]; |
| 30 | |
| 31 | const handleThemeChange = (theme: Theme) => { |
| 32 | settingStore.setTheme(theme); |
| 33 | }; |
| 34 | |
| 35 | return <Select className="w-auto min-w-[120px]" value={theme} itemList={themeItemList} onValueChange={handleThemeChange} />; |
| 36 | }; |
| 37 | |
| 38 | export default ThemeSelector; |
nothing calls this directly
no outgoing calls
no test coverage detected