"use client";

import { ThemeProvider as NextThemesProvider, type ThemeProviderProps } from "next-themes";

/**
 * App-wide theme provider. Wraps next-themes with class-based dark mode so the
 * `.dark` token overrides in globals.css apply. `disableTransitionOnChange`
 * prevents a flash of color transitions when toggling.
 */
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
  return (
    <NextThemesProvider
      attribute="class"
      defaultTheme="light"
      enableSystem
      disableTransitionOnChange
      {...props}
    >
      {children}
    </NextThemesProvider>
  );
}
