import type { Metadata, Viewport } from "next";
import "./globals.css";

const basePath = "/project/SquizZup/out";
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL ?? "https://5ka.fr/project/SquizZup/out/";

export const metadata: Metadata = {
  metadataBase: new URL(siteUrl),
  title: "Squiz’Zup — Le jeu qui met l’ambiance",
  description: "Faites deviner, jouez en équipe et enchaînez trois manches pleines d’ambiance.",
  applicationName: "Squiz’Zup",
  manifest: basePath + "/manifest.webmanifest",
  appleWebApp: { capable: true, statusBarStyle: "black-translucent", title: "Squiz’Zup" },
  formatDetection: { telephone: false },
  icons: {
    icon: [
      { url: basePath + "/icons/favicon-32.png", sizes: "32x32", type: "image/png" },
      { url: basePath + "/icons/icon-192-v2.png", sizes: "192x192", type: "image/png" },
      { url: basePath + "/icons/icon-512-v2.png", sizes: "512x512", type: "image/png" }
    ],
    shortcut: [{ url: basePath + "/icons/favicon-32.png", sizes: "32x32", type: "image/png" }],
    apple: [{ url: basePath + "/icons/apple-touch-icon-v2.png", sizes: "180x180", type: "image/png" }]
  },
  openGraph: {
    type: "website",
    locale: "fr_FR",
    title: "Squiz’Zup — Le jeu qui met l’ambiance",
    description: "Trois manches, une mission : faire deviner.",
    images: [{ url: basePath + "/og.png", width: 1536, height: 1024, alt: "Squiz’Zup, le jeu qui met l’ambiance" }]
  },
  twitter: {
    card: "summary_large_image",
    title: "Squiz’Zup — Le jeu qui met l’ambiance",
    description: "Trois manches, une mission : faire deviner.",
    images: [basePath + "/og.png"]
  }
};

export const viewport: Viewport = {
  width: "device-width",
  initialScale: 1,
  maximumScale: 1,
  viewportFit: "cover",
  themeColor: "#7541c3"
};

export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
  return <html lang="fr"><body>{children}</body></html>;
}
