CoreControl/app/layout.tsx

52 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-04-11 12:27:44 +02:00
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import { ThemeProvider } from "@/components/theme-provider"
2025-04-28 23:19:55 +02:00
import {NextIntlClientProvider} from 'next-intl';
import {getLocale} from 'next-intl/server';
2025-04-29 20:14:44 +02:00
import {cookies} from 'next/headers';
2025-04-11 12:27:44 +02:00
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "CoreControl",
description: "The only Dashboard you will need for your Services",
};
2025-04-29 20:14:44 +02:00
export default async function RootLayout({
2025-04-11 12:27:44 +02:00
children,
}: Readonly<{
children: React.ReactNode;
}>) {
2025-04-29 20:14:44 +02:00
const cookieStore = await cookies();
const locale = cookieStore.get('language')?.value || 'en';
const messages = (await import(`@/i18n/languages/${locale}.json`)).default;
2025-04-11 12:27:44 +02:00
return (
2025-04-29 20:14:44 +02:00
<html lang={locale}>
2025-04-11 12:27:44 +02:00
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<ThemeProvider
attribute="class"
2025-04-12 20:01:43 +02:00
defaultTheme="system"
2025-04-11 12:27:44 +02:00
enableSystem
disableTransitionOnChange
>
2025-04-29 20:14:44 +02:00
<NextIntlClientProvider locale={locale} messages={messages}>
2025-04-28 23:19:55 +02:00
{children}
</NextIntlClientProvider>
2025-04-11 12:27:44 +02:00
</ThemeProvider>
</body>
</html>
);
}