// app/layout.tsx (server)
import './globals.css';
import { Providers } from './providers';
import type { ReactNode } from 'react';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/lib/auth-options';
import { Toaster } from "@/components/ui/sonner"

export const metadata = {
  title: 'OW ANIMATION ARTS VAULT',
  description: '...',
};

export default async function RootLayout({ children }: { children: ReactNode }) {
  // get server session and pass into client SessionProvider for identical initial markup
  const session = await getServerSession(authOptions);

  return (
    <html lang="en">
      <body className="antialiased bg-background text-foreground">
        {/* pass session to Providers to avoid client/server mismatch */}
        <Providers session={session}>{children}</Providers>
        <Toaster />
      </body>
    </html>
  );
}
