32 lines
940 B
TypeScript
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>
|
||
|
|
);
|
||
|
|
}
|