()
| 7 | const [theme, setTheme] = useTheme(); |
| 8 | |
| 9 | const toggleTheme = () => { |
| 10 | setTheme((prevTheme) => (prevTheme === "light" ? "dark" : "light")); |
| 11 | }; |
| 12 | const SwitchIcon = theme === "light" ? MoonIcon : SunIcon; |
| 13 | |
| 14 | useHotkeys("alt+t", () => toggleTheme(), [toggleTheme]); |