SPB Git
1.7 KB · 31 lines tsx
1import type { Metadata, Viewport } from "next";2import { Geist, Geist_Mono } from "next/font/google";3import "./globals.css";4import { cookies } from "next/headers";56const geistSans = Geist({ variable: "--font-geist-sans", subsets: ["latin"], display: "swap" });7const geistMono = Geist_Mono({ variable: "--font-geist-mono", subsets: ["latin"], display: "swap" });89export const metadata: Metadata = {10  title: { default: "Chat SPBoucher AI", template: "%s · Chat SPBoucher AI" },11  description: "Interface privée multi-modèles de Simon-Pierre Boucher",12  applicationName: "Chat SPBoucher AI",13  manifest: "/manifest.webmanifest",14  appleWebApp: { capable: true, statusBarStyle: "black-translucent", title: "SPB AI" },15  icons: { icon: "/icons/icon-192.png", apple: "/icons/apple-touch-icon.png" },16  robots: { index: false, follow: false },17};18export const viewport: Viewport = { themeColor: [{ media: "(prefers-color-scheme: dark)", color: "#0a0c10" }, { media: "(prefers-color-scheme: light)", color: "#f7f8fb" }], width: "device-width", initialScale: 1, viewportFit: "cover", maximumScale: 1 };1920export default async function RootLayout({ children }: { children: React.ReactNode }) {21  const theme = (await cookies()).get("csa_theme")?.value ?? "dark";22  return (23    <html lang="fr" data-theme={theme === "system" ? undefined : theme} className={`${geistSans.variable} ${geistMono.variable} h-full`} suppressHydrationWarning>24      <head>25        {theme === "system" && <script dangerouslySetInnerHTML={{ __html: `document.documentElement.dataset.theme = matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';` }} />}26      </head>27      <body className="h-full">{children}</body>28    </html>29  );30}31
Files · main
Menu

Theme