Files
cameleer-server/ui/src/theme/ThemeProvider.tsx

13 lines
336 B
TypeScript
Raw Normal View History

import { useEffect } from 'react';
import { useThemeStore } from './theme-store';
export function ThemeProvider({ children }: { children: React.ReactNode }) {
const theme = useThemeStore((s) => s.theme);
useEffect(() => {
document.documentElement.setAttribute('data-theme', theme);
}, [theme]);
return <>{children}</>;
}