()
| 99 | } |
| 100 | |
| 101 | export function useTheme() { |
| 102 | const [theme, setTheme] = useState<ColorModeThemes>({ |
| 103 | css: defaultCSSTheme, |
| 104 | component: defaultComponentTheme, |
| 105 | }) |
| 106 | |
| 107 | useEffect(() => { |
| 108 | const cookieValue = Cookies.get('color_mode') |
| 109 | const css = getCssTheme(cookieValue) |
| 110 | const component = getComponentTheme(cookieValue) |
| 111 | setTheme({ css, component }) |
| 112 | }, []) |
| 113 | |
| 114 | return { theme } |
| 115 | } |
no test coverage detected