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

Function ThemeSwitch

src/components/ThemeSwitch.tsx:4–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import Icon from "./Icon";
3
4const ThemeSwitch = () => {
5 const settingStore = useSettingStore();
6 const theme = settingStore.setting.theme;
7
8 const handleThemeChange = () => {
9 if (theme === "light") {
10 settingStore.setLocale("zh");
11 } else {
12 settingStore.setLocale("en");
13 }
14 };
15
16 return (
17 <button className="w-10 h-10 p-1 rounded-full flex flex-row justify-center items-center hover:bg-gray-100" onClick={handleThemeChange}>
18 <Icon.IoSunny className="text-gray-600 w-6 h-auto" />
19 </button>
20 );
21};
22
23export default ThemeSwitch;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected