20 lines
817 B
TypeScript
20 lines
817 B
TypeScript
import type { ReactNode } from "react";
|
|
import { cookies } from "next/headers";
|
|
import { GeistSans } from "geist/font/sans";
|
|
import { GeistMono } from "geist/font/mono";
|
|
import { cn } from "@/lib/utils";
|
|
import { THEME_COOKIE } from "@/lib/theme";
|
|
import "./app.css";
|
|
|
|
export const metadata = { title: "Peppa", description: "Софтвейр-фабрика: проекты, стори и агенты" };
|
|
|
|
export default async function RootLayout({ children }: { children: ReactNode }) {
|
|
// Dark by default; the cookie is read on the server so a light choice renders without a dark flash.
|
|
const light = (await cookies()).get(THEME_COOKIE)?.value === "light";
|
|
return (
|
|
<html lang="ru" className={cn(GeistSans.variable, GeistMono.variable, !light && "dark")}>
|
|
<body>{children}</body>
|
|
</html>
|
|
);
|
|
}
|