"use client";

import { ThemeProvider } from "next-themes";
import { usePathname } from "next/navigation";

export function Providers({ children }) {
  const router = usePathname();

  return (
    <ThemeProvider
      attribute={router.includes("/panel") ? "class" : "data-"}
      defaultTheme="system"
      enableSystem
    >
      {children}
    </ThemeProvider>
  );
}
