Neah_Front/app/layout.tsx
2025-04-08 14:45:23 +02:00

37 lines
1.0 KiB
TypeScript

import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import { headers } from "next/headers";
import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { Providers } from "@/components/providers";
import { LayoutWrapper } from "@/components/layout/layout-wrapper";
const inter = Inter({ subsets: ["latin"] });
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const session = await getServerSession(authOptions);
const headersList = headers();
const pathname = headersList.get("x-pathname") || "";
const isSignInPage = pathname === "/signin";
return (
<html lang="fr">
<body className={inter.className}>
<Providers>
<LayoutWrapper
isSignInPage={isSignInPage}
isAuthenticated={!!session}
>
{children}
</LayoutWrapper>
</Providers>
</body>
</html>
);
}