โ– humdrum codex / soft
1.5 KB raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import type { Metadata, Viewport } from "next";
import { cookies } from "next/headers";
import { AppNav } from "@/components/AppNav";
import { OfflineBanner } from "@/components/OfflineBanner";
import { ServiceWorkerRegistration } from "@/components/ServiceWorkerRegistration";
import { ThemeInitializer } from "@/components/ThemeInitializer";
import { ShortcutsRoot } from "@/components/ShortcutsRoot";
import "./globals.css";

export const metadata: Metadata = {
  title: "Personal Dashboard",
  description: "Local dashboard โ€” weather, news, history, todos, feeds, and a daily paper.",
  manifest: "/manifest.json",
  icons: {
    icon: "/icons/icon-192.png",
    apple: "/icons/apple-touch-icon.png",
  },
  appleWebApp: {
    capable: true,
    statusBarStyle: "black-translucent",
    title: "Dashboard",
  },
};

export const viewport: Viewport = {
  width: "device-width",
  initialScale: 1,
  viewportFit: "cover",
};

export default async function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const cookieStore = await cookies();
  const initialTheme = cookieStore.get("app-theme")?.value ?? "humdrum";

  return (
    <html lang="en" data-theme={initialTheme} suppressHydrationWarning>
      <body
        style={{
          background: "var(--bg)",
          color: "var(--text)",
          fontFamily: "var(--font-body)",
        }}
      >
        <ThemeInitializer />
        <ShortcutsRoot />
        <ServiceWorkerRegistration />
        <AppNav />
        {children}
        <OfflineBanner />
      </body>
    </html>
  );
}