mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-09 15:14:58 -05:00
18 lines
477 B
TypeScript
18 lines
477 B
TypeScript
|
|
"use client";
|
||
|
|
|
||
|
|
import * as React from "react";
|
||
|
|
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
||
|
|
import { type ThemeProviderProps } from "next-themes/dist/types";
|
||
|
|
|
||
|
|
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
||
|
|
const [mounted, setMounted] = React.useState(false);
|
||
|
|
|
||
|
|
React.useEffect(() => {
|
||
|
|
setMounted(true);
|
||
|
|
}, []);
|
||
|
|
|
||
|
|
if (!mounted) return null;
|
||
|
|
|
||
|
|
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
|
||
|
|
}
|