peppa/apps/web/app/layout.tsx
Асель 6e54fc69a6 PEP-91: Peppa reports its own errors to Bugsink — backend to PEP-api, browser to PEP-web
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 12:39:46 +05:00

24 lines
949 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 { ErrorReporter } from "@/components/ErrorReporter";
import "./app.css";
export const metadata = { title: "Peppa", description: "Софтвейр-фабрика: проекты, стори и агенты", icons: { icon: "/icon.svg" } };
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>
<ErrorReporter />
{children}
</body>
</html>
);
}