import { ThemeProvider as NextThemes } from "next-themes";

export function ThemeProvider({ children }: { children: React.ReactNode }) {
  // next-themes writes the class/style attributes on <html> at mount. The old
  // mount-gate produced a hydration mismatch (SSR html had no class, client
  // added `dark`). Just render — `suppressHydrationWarning` on <html> handles it.
  return (
    <NextThemes attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
      {children}
    </NextThemes>
  );
}
