52 lines
1.1 KiB
TypeScript
52 lines
1.1 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Geist, Geist_Mono } from "next/font/google";
|
|
import "../globals.css";
|
|
import { Toaster } from "@/components/ui/sonner";
|
|
|
|
const geistSans = Geist({
|
|
variable: "--font-geist-sans",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
const geistMono = Geist_Mono({
|
|
variable: "--font-geist-mono",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
import { getDictionary } from "@/get-dictionary";
|
|
|
|
export async function generateMetadata({ params }: { params: Promise<{ lang: string }> }): Promise<Metadata> {
|
|
const { lang } = await params;
|
|
const dict = await getDictionary(lang as any);
|
|
|
|
return {
|
|
title: dict.home.title,
|
|
description: dict.home.description,
|
|
};
|
|
}
|
|
|
|
export async function generateStaticParams() {
|
|
return [{ lang: "en" }, { lang: "de" }];
|
|
}
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
params,
|
|
}: {
|
|
children: React.ReactNode;
|
|
params: Promise<{ lang: string }>;
|
|
}) {
|
|
const { lang } = await params;
|
|
|
|
return (
|
|
<html lang={lang}>
|
|
<body
|
|
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
|
>
|
|
{children}
|
|
<Toaster />
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|