63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Manrope, Sora } from "next/font/google";
|
|
import "./globals.css";
|
|
import { Providers } from "@/app/providers";
|
|
import { buildUiAppearanceStyle } from "@/lib/ui-appearance";
|
|
import { SETTING_KEYS } from "@/lib/constants";
|
|
import { getSetting } from "@/lib/settings";
|
|
import { AccentColorScript } from "@/components/layout/accent-color";
|
|
|
|
const manrope = Manrope({
|
|
subsets: ["latin"],
|
|
variable: "--font-manrope"
|
|
});
|
|
|
|
const sora = Sora({
|
|
subsets: ["latin"],
|
|
variable: "--font-sora"
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: "CalBook",
|
|
description: "Moderne, mobile-first Terminbuchung auf Deutsch"
|
|
};
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function RootLayout({
|
|
children
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const selectedThemeId = "theme:monochrome-ink-glass";
|
|
const appearanceStyle = buildUiAppearanceStyle({
|
|
themeId: selectedThemeId,
|
|
bodyFontId: "font:manrope",
|
|
headingFontId: "font:sora"
|
|
});
|
|
|
|
let accentColor = "#4f46e5";
|
|
try {
|
|
const color = await getSetting(SETTING_KEYS.BRANDING_ACCENT_COLOR);
|
|
if (color && /^#[0-9a-fA-F]{6}$/.test(color)) accentColor = color;
|
|
} catch { /* use default */ }
|
|
|
|
const combinedStyle = { ...(appearanceStyle as React.CSSProperties), "--accent": accentColor };
|
|
|
|
return (
|
|
<html
|
|
lang="de"
|
|
suppressHydrationWarning
|
|
data-ui-theme={selectedThemeId}
|
|
style={combinedStyle as React.CSSProperties}
|
|
>
|
|
<body className={`${manrope.variable} ${sora.variable} font-sans`}>
|
|
<AccentColorScript color={accentColor} />
|
|
<Providers themeMode="light">
|
|
<main className="min-h-screen">{children}</main>
|
|
</Providers>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|