35 lines
859 B
TypeScript
35 lines
859 B
TypeScript
import type { Metadata } from "next";
|
|
import { unstable_noStore as noStore } from "next/cache";
|
|
import { getLocale } from "next-intl/server";
|
|
import { ThemeProvider } from "@/components/theme-provider";
|
|
import { buildAppMetadata } from "@/lib/metadata";
|
|
import { getDirection } from "@/lib/locale";
|
|
import "./globals.css";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
export const revalidate = 0;
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
noStore();
|
|
|
|
return buildAppMetadata();
|
|
}
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
noStore();
|
|
|
|
const locale = await getLocale().catch(() => "de");
|
|
|
|
return (
|
|
<html lang={locale} dir={getDirection(locale)} suppressHydrationWarning>
|
|
<body>
|
|
<ThemeProvider>{children}</ThemeProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|