import type { Metadata } from "next"; import { Geist, Geist_Mono } from "next/font/google"; import { notFound } from "next/navigation"; import { IntlProvider } from "@/components/providers/intl-provider"; import { ThemeProvider } from "@/components/providers/theme-provider"; import { locales } from "@/i18n/routing"; import "../globals.css"; const geistSans = Geist({ variable: "--font-geist-sans", subsets: ["latin"], }); const geistMono = Geist_Mono({ variable: "--font-geist-mono", subsets: ["latin"], }); export const metadata: Metadata = { title: "JMAP Webmail", description: "Minimalist webmail client using JMAP protocol", }; export default async function LocaleLayout({ children, params }: { children: React.ReactNode; params: Promise<{ locale: string }>; }) { const { locale } = await params; // Validate that the incoming `locale` parameter is valid if (!(locales as readonly string[]).includes(locale)) notFound(); // Load messages for the current locale let messages; try { messages = (await import(`@/locales/${locale}/common.json`)).default; } catch { notFound(); } return (