MCPcopy Create free account
hub / github.com/sqlchat/sqlchat / ThemeSelector

Function ThemeSelector

src/components/ThemeSelector.tsx:11–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9}
10
11const 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
38export default ThemeSelector;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected