import { ReactNode } from "react"; import { NextIntlClientProvider } from "next-intl"; import { getTranslations } from "next-intl/server"; import { Inter, Julius_Sans_One } from "next/font/google"; import { notFound } from "next/navigation"; import Script from "next/script"; import "@/css/globals.css"; import Providers from "@/providers"; import Footer from "./(main)/components/Footer"; import Navbar from "./(main)/components/Navbar"; const inter = Inter({ subsets: ["latin"], variable: "--font-inter" }); const title = Julius_Sans_One({ subsets: ["latin"], weight: "400", variable: "--font-title", }); export async function generateMetadata({ params: { locale }, }: { params: { locale?: string }; }) { // While the `locale` is required, the namespace is optional and // identical to the parameter that `useTranslations` accepts. const t = await getTranslations({ locale: locale ?? "en", namespace: "Metadata", }); return { title: t("title"), description: t("description"), keywords: t("keywords"), }; } export default async function RootLayout({ children, params: { locale }, }: { children: ReactNode; params: { locale?: string }; }) { let messages; try { messages = (await import(`@/messages/${locale}.json`)).default; } catch (error) { notFound(); } return (
{children}