import type { Metadata, Viewport } from "next"; import "./globals.css"; import { Providers } from "./providers"; import { Header } from "./components/Header"; import { Footer } from "./components/Footer"; import { BackToTop } from "./components/BackToTop"; import { Background } from "./components/Background"; import { ScrollReveal } from "./components/ScrollReveal"; import { SITE_DESCRIPTION, SITE_NAME, SITE_URL } from "./lib/site"; export const metadata: Metadata = { metadataBase: new URL(SITE_URL), title: { default: "CoHaiSe — Développement web, applications et design sur mesure", template: "%s | CoHaiSe", }, description: SITE_DESCRIPTION, applicationName: SITE_NAME, authors: [{ name: "Esiah", url: SITE_URL }], creator: "CoHaiSe", publisher: "CoHaiSe", category: "technology", keywords: [ "développement web", "site vitrine", "application mobile", "React", "Next.js", "UI UX design", "logiciel sur mesure", "CoHaiSe", ], alternates: { canonical: "/", }, openGraph: { type: "website", locale: "fr_FR", url: SITE_URL, siteName: SITE_NAME, title: "CoHaiSe — Développement web, applications et design sur mesure", description: SITE_DESCRIPTION, images: [ { url: "/images/cohaise.webp", width: 512, height: 512, alt: "CoHaiSe", }, ], }, twitter: { card: "summary_large_image", title: "CoHaiSe — Développement web, applications et design sur mesure", description: SITE_DESCRIPTION, images: ["/images/cohaise.webp"], }, icons: { icon: [{ url: "/favicon.webp", type: "image/webp" }], shortcut: ["/favicon.webp"], }, robots: { index: true, follow: true, googleBot: { index: true, follow: true }, }, }; export const viewport: Viewport = { colorScheme: "light dark", themeColor: [ { media: "(prefers-color-scheme: light)", color: "#f7f5f4" }, { media: "(prefers-color-scheme: dark)", color: "#050000" }, ], }; // Script anti-FOUC : applique le thème enregistré avant le premier rendu. const themeScript = `(() => { try { const stored = localStorage.getItem("cohaise-theme"); const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches; const theme = stored ?? (prefersDark ? "dark" : "light"); if (theme === "dark") document.documentElement.classList.add("dark"); } catch {} })();`; export default function RootLayout({ children, }: { children: React.ReactNode; }) { return (