import { ReactNode } from "react"; import { NextIntlClientProvider } from "next-intl"; import { getMessages, getTranslations } from "next-intl/server"; import { notFound } from "next/navigation"; import { locales, Locale } from "@/i18n"; import "../globals.css"; import { Header } from "@/components/layout/Header"; import { Footer } from "@/components/layout/Footer"; import localFont from "next/font/local"; export async function generateMetadata({ params: { locale }, }: { params: { locale: string }; }) { const t = await getTranslations({ locale, namespace: "metadata" }); return { metadataBase: new URL("https://bb-apartment.de"), title: { template: `%s | ${t("title")}`, default: t("title"), }, description: t("description"), alternates: { canonical: `/${locale}`, languages: { "de-DE": "/de", "en-US": "/en", "x-default": "/de", }, }, openGraph: { type: "website", locale: locale === "de" ? "de_DE" : "en_US", url: `https://bb-apartment.de/${locale}`, siteName: "BB-Apartment", title: t("title"), description: t("description"), }, twitter: { card: "summary_large_image", title: t("title"), description: t("description"), }, robots: { index: true, follow: true, }, }; } const geistSans = localFont({ src: "../fonts/GeistVF.woff", variable: "--font-geist-sans", weight: "100 900", }); export default async function LocaleLayout({ children, params: { locale }, }: { children: ReactNode; params: { locale: string }; }) { if (!locales.includes(locale as Locale)) notFound(); const messages = await getMessages(); return (
{children}