"use client";

import { NeonAuthUIProvider } from "@neondatabase/auth/react";
import { ThemeProvider } from "@/components/theme-provider";
import { Toaster } from "@/components/ui/toaster";
import { authClient } from "@/lib/auth/client";

export default function PlatformLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <ThemeProvider
      attribute="class"
      defaultTheme="system"
      enableSystem
      disableTransitionOnChange
    >
      <NeonAuthUIProvider
        authClient={authClient}
        redirectTo="/platform/dashboard"
        emailOTP
        credentials={{ forgotPassword: true }}
      >
        {children}
        <Toaster />
      </NeonAuthUIProvider>
    </ThemeProvider>
  );
}
