import type { Metadata } from 'next'; import { Inter } from 'next/font/google'; import { notFound } from 'next/navigation'; import { peyda } from '../fonts'; import '../globals.css'; import { Providers } from '@/components/providers'; import { I18nProvider } from '@/i18n/I18nProvider'; import { getDictionary } from '@/i18n/dictionaries'; import { isLocale, dirFor, locales, type Locale } from '@/i18n/config'; const inter = Inter({ subsets: ['latin'], variable: '--font-inter' }); export function generateStaticParams() { return locales.map((lang) => ({ lang })); } export async function generateMetadata({ params, }: { params: { lang: string }; }): Promise { if (!isLocale(params.lang)) return {}; const dict = await getDictionary(params.lang); return { title: dict.meta.title, description: dict.meta.description }; } export default async function RootLayout({ children, params, }: { children: React.ReactNode; params: { lang: string }; }) { if (!isLocale(params.lang)) notFound(); const locale: Locale = params.lang; const dict = await getDictionary(locale); const dir = dirFor(locale); const fontClass = locale === 'fa-IR' ? 'font-peyda' : 'font-sans'; return ( {children} ); }