import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import { auth } from "@/auth";
import { Header } from "@/components/Header";
import { ThemeProvider } from "@/components/ThemeProvider";
import { SessionProvider } from "@/components/SessionProvider";
import "./globals.css";

const geistSans = Geist({
  variable: "--font-geist-sans",
  subsets: ["latin"],
});

const geistMono = Geist_Mono({
  variable: "--font-geist-mono",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "Évaluateur Maturité IA Gen",
  description: "Outil d'évaluation de la maturité IA Gen par Peaksys",
  icons: {
    icon: "/iconfull.png",
    shortcut: "/iconfull.png",
    apple: "/iconfull.png",
  },
  manifest: "/manifest.json",
};

export default async function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  const session = await auth();
  return (
    <html lang="fr" suppressHydrationWarning>
      <body className={`${geistSans.variable} ${geistMono.variable} min-h-screen bg-zinc-100 text-zinc-900 dark:bg-zinc-950 dark:text-zinc-50 antialiased`}>
        <SessionProvider>
          <ThemeProvider>
            <Header session={session} />
            <main className="mx-auto max-w-7xl px-4 py-6">{children}</main>
          </ThemeProvider>
        </SessionProvider>
      </body>
    </html>
  );
}
