Files
pulsenode/app/layout.tsx
T
valknar 80c2362ac2 feat: scaffold PulseNode dashboard (M1)
Next.js 16 + TypeScript + Tailwind v4 app with a YAML-driven config
system: schema validation (zod), .env interpolation, and a widget
registry rendering bookmark/search/group widgets. CSS custom
properties (--pn-*) drive theming and are overridable from
config.yml's theme.variables. Config load errors surface as a
readable error page instead of crashing the app.

Hot reload, docker/system/http collectors, and the WebSocket push
layer land in later milestones per the approved plan.
2026-08-17 13:49:55 +02:00

32 lines
940 B
TypeScript

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<string, string> = {};
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 (
<html lang="en" data-theme={mode} className="h-full">
<head>
<ThemeStyleInjector variables={variables} />
</head>
<body className="min-h-full antialiased">{children}</body>
</html>
);
}