fix bug window

This commit is contained in:
Ehsan
2024-09-30 14:30:43 +03:30
parent cecd572861
commit f306a7c3d2
+3 -2
View File
@@ -1,13 +1,14 @@
"use client";
import { ThemeProvider } from "next-themes";
import { usePathname } from "next/navigation";
export function Providers({ children }) {
const isDark = window.location.pathname.includes("/panel");
const router = usePathname();
return (
<ThemeProvider
attribute={isDark ? "class" : "data-"}
attribute={router.includes("/panel") ? "class" : "data-"}
defaultTheme="system"
enableSystem
>