peppa/apps/web/app/layout.tsx
peppa-bot 1ef3bd7c98
Some checks failed
peppa/lint lint: success за 2с
peppa/typecheck typecheck: success за 53с
peppa/build build: success за 40с
peppa/bundle bundle: success за 2с
peppa/test test: failure за 1869с
peppa-ci / ci (pull_request) Failing after 33m54s
PEP-217: слияние с main — конфликты решены, терминал на /sessions грузится по требованию, эталон веса JS обновлён
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 19:38:45 +00:00

33 lines
1.4 KiB
TypeScript

import type { ReactNode } from "react";
import { cookies } from "next/headers";
import { GeistSans } from "geist/font/sans";
import { GeistMono } from "geist/font/mono";
import { dictionary, productName } from "@peppa/shared/i18n";
import { cn } from "@/lib/utils";
import { THEME_COOKIE } from "@/lib/theme";
import { getLocale, getT } from "@/lib/i18n";
import { ErrorReporter } from "@/components/ErrorReporter";
import { I18nProvider } from "@/components/I18n";
import "./app.css";
export async function generateMetadata() {
const t = await getT();
return { title: productName(t.locale), description: t("FORGE: опишите идею словами — ИИ-агенты сделают продукт"), 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";
const locale = await getLocale();
return (
<html lang={locale === "kk" ? "kk" : locale} className={cn(GeistSans.variable, GeistMono.variable, !light && "dark")}>
<body>
<I18nProvider locale={locale} dict={locale === "ru" ? undefined : dictionary(locale)}>
<ErrorReporter />
{children}
</I18nProvider>
</body>
</html>
);
}