import type { Metadata } from "next"; import type { ReactNode } from "react"; import { cookies } from "next/headers"; import Link from "next/link"; import { Doto, Geist, Geist_Mono } from "next/font/google"; import { BRAND, LogoMark } from "@/components/brand"; import { SiteHeader, SiteSidebar, TopBar } from "@/components/header"; import { Providers } from "@/components/providers"; import { ThemeToggle } from "@/components/theme-toggle"; import { THEME_COOKIE, colorwayOf, type Theme } from "@/lib/theme"; import { getViewer } from "@/lib/auth"; import "@unlocalhosted/metalui/styles.css"; import "@unlocalhosted/metalui/icons.css"; import "./globals.css"; const geist = Geist({ variable: "--font-geist", subsets: ["latin"], }); const geistMono = Geist_Mono({ variable: "--font-geist-mono", subsets: ["latin"], }); /** MetalUI's dot-matrix face, for its pixel type roles. */ const doto = Doto({ variable: "--font-doto", subsets: ["latin"], weight: "700", }); export const metadata: Metadata = { metadataBase: new URL(`https://${BRAND.domain}`), title: { default: BRAND.name, template: `%s · ${BRAND.name}` }, description: "A self-hosted home for your git repositories", }; export default async function RootLayout({ children }: LayoutProps<"/">) { const viewer = await getViewer(); const stored = (await cookies()).get(THEME_COOKIE)?.value; const theme: Theme = stored === "light" || stored === "dark" ? stored : "system"; return (