import { isLocale } from '@impuestos/i18n'; import type { Metadata } from 'next'; import { Inter } from 'next/font/google'; import { NextIntlClientProvider } from 'next-intl'; import { setRequestLocale } from 'next-intl/server'; import { getT } from '@/i18n/t'; import { notFound } from 'next/navigation'; import type { ReactNode } from 'react'; import { Providers } from '@/components/providers'; import { routing } from '@/i18n/routing'; import '../globals.css'; // Self hosted by next/font: no third party font request at runtime, which keeps the // CSP tight (SPEC.md section 14). const inter = Inter({ subsets: ['latin'], variable: '--font-inter', display: 'swap' }); export function generateStaticParams() { return routing.locales.map((locale) => ({ locale })); } export async function generateMetadata(props: { params: Promise<{ locale: string }>; }): Promise { const { locale } = await props.params; const t = await getT(locale); return { title: t('common.appName') }; } export default async function LocaleLayout({ children, params, }: { children: ReactNode; params: Promise<{ locale: string }>; }) { const { locale } = await params; if (!isLocale(locale)) notFound(); setRequestLocale(locale); return ( {children} ); }