import type { Metadata, Viewport } from 'next'; import { cookies } from 'next/headers'; import '@/src/index.css'; import '@/src/App.css'; import '@/src/css/Unit.css'; import '@/src/css/Building.css'; import { ThemeProvider } from '@/src/context/ThemeContext'; import AppShell from '@/components/AppShell'; const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://dow-wiki.example.com'; export const metadata: Metadata = { metadataBase: new URL(siteUrl), title: { default: 'Dawn of War Wiki — юниты, расы и здания всех модов', template: '%s — Dawn of War Wiki', }, description: 'Dawn of War wiki. Unification mod wiki. Unification mod unit stats. Supported all popular mods.', manifest: '/manifest.json', applicationName: 'Dawn of War Wiki', verification: { google: 'Q4XMn2UDpL2xmK7iBfaWQpVN8EPy8oGxN-7HqSKapb0', }, openGraph: { type: 'website', siteName: 'Dawn of War Wiki', title: 'Dawn of War Wiki — юниты, расы и здания всех модов', description: 'Dawn of War wiki. Unification mod wiki. Unification mod unit stats. Supported all popular mods.', images: ['/logo512.png'], }, twitter: { card: 'summary_large_image', }, robots: { index: true, follow: true, }, }; export const viewport: Viewport = { themeColor: '#000000', width: 'device-width', initialScale: 1, }; export default function RootLayout({ children, }: { children: React.ReactNode; }) { // Читаем тему из cookie на сервере, чтобы сразу отрендерить нужную тему без мерцания. const themeCookie = cookies().get('theme')?.value; const initialMode = themeCookie === 'light' ? 'light' : 'dark'; return ( {/* Yandex.Metrika */}