Spaces:
Sleeping
Sleeping
File size: 422 Bytes
3786a3f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 'use client';
import { useEffect } from 'react';
import { useThemeStore } from '@/store/theme';
export function ThemeProvider({ children }: { children: React.ReactNode }) {
const theme = useThemeStore((s) => s.theme);
useEffect(() => {
const root = document.documentElement;
if (theme === 'dark') root.classList.add('dark');
else root.classList.remove('dark');
}, [theme]);
return <>{children}</>;
}
|