import type { Metadata } from "next"; import { Geist, Geist_Mono } from "next/font/google"; import { headers } from "next/headers"; import { getLocale } from "next-intl/server"; import { PWAInstallPrompt } from "@/components/pwa-install-prompt"; import { ServiceWorkerRegistration } from "@/components/service-worker-registration"; import "./globals.css"; const geistSans = Geist({ variable: "--font-geist-sans", subsets: ["latin"], }); const geistMono = Geist_Mono({ variable: "--font-geist-mono", subsets: ["latin"], }); export async function generateMetadata(): Promise { const faviconUrl = process.env.FAVICON_URL; return { title: process.env.APP_NAME || process.env.NEXT_PUBLIC_APP_NAME || "Webmail", description: "Minimalist webmail client using JMAP protocol", appleWebApp: { capable: true, statusBarStyle: "black-translucent", title: process.env.APP_NAME || process.env.NEXT_PUBLIC_APP_NAME || "Webmail", }, formatDetection: { telephone: false, }, ...(faviconUrl ? { icons: { icon: faviconUrl } } : {}), }; } export default async function RootLayout({ children, }: { children: React.ReactNode; }) { const locale = await getLocale(); const nonce = (await headers()).get("x-nonce") ?? ""; const parentOrigin = process.env.NEXT_PUBLIC_PARENT_ORIGIN || ""; return ( {parentOrigin && ( )}