Finalish MVP
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import { cookies } from "next/headers";
|
||||
import "./globals.css";
|
||||
|
||||
const geistSans = Geist({ variable: "--font-geist-sans", subsets: ["latin"] });
|
||||
@@ -10,9 +11,15 @@ export const metadata: Metadata = {
|
||||
description: "MaliounTech Industrial Suite",
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||
const cookieJar = await cookies();
|
||||
const themeCookie = cookieJar.get("mis_theme")?.value;
|
||||
const localeCookie = cookieJar.get("mis_locale")?.value;
|
||||
const theme = themeCookie === "light" ? "light" : "dark";
|
||||
const locale = localeCookie === "es-MX" ? "es-MX" : "en";
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
<html lang={locale} data-theme={theme}>
|
||||
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
|
||||
{children}
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user