import type { Metadata } from "next"; import "./globals.css"; import { configStore } from "@/lib/config/loader"; import { ThemeStyleInjector } from "@/components/layout/ThemeStyleInjector"; export const metadata: Metadata = { title: "PulseNode", description: "Self-hosted infrastructure dashboard", }; export default function RootLayout({ children }: LayoutProps<"/">) { let mode: "dark" | "light" = "dark"; let variables: Record = {}; try { const config = configStore.get(); mode = config.theme.mode === "light" ? "light" : "dark"; variables = config.theme.variables; } catch { // page.tsx surfaces the actual config error; layout falls back to defaults } return ( {children} ); }