2026-08-17 14:01:53 +02:00
|
|
|
"use client";
|
|
|
|
|
|
2026-08-17 13:49:55 +02:00
|
|
|
import type { Config } from "@/lib/config/schema";
|
2026-08-17 14:01:53 +02:00
|
|
|
import { useConfigSubscription } from "@/lib/ws/client";
|
2026-08-17 13:49:55 +02:00
|
|
|
import { GroupSection } from "./GroupSection";
|
2026-08-17 14:27:07 +02:00
|
|
|
import { ThemeToggle } from "./ThemeToggle";
|
|
|
|
|
import { PulseMark } from "./PulseMark";
|
2026-08-17 13:49:55 +02:00
|
|
|
|
2026-08-17 14:01:53 +02:00
|
|
|
export function Dashboard({ config: initialConfig }: { config: Config }) {
|
|
|
|
|
const config = useConfigSubscription(initialConfig);
|
|
|
|
|
|
2026-08-17 13:49:55 +02:00
|
|
|
return (
|
|
|
|
|
<main className="mx-auto flex max-w-6xl flex-col gap-8 px-6 py-10">
|
2026-08-17 14:27:07 +02:00
|
|
|
<header className="flex items-center justify-between gap-4">
|
|
|
|
|
<div className="flex items-center gap-3">
|
|
|
|
|
<PulseMark />
|
|
|
|
|
<h1 className="font-display text-lg font-semibold tracking-tight text-fg">
|
|
|
|
|
{config.settings.title}
|
|
|
|
|
</h1>
|
|
|
|
|
</div>
|
|
|
|
|
<ThemeToggle />
|
2026-08-17 13:49:55 +02:00
|
|
|
</header>
|
2026-08-17 14:01:53 +02:00
|
|
|
{config.groups.map((group, groupIndex) => (
|
|
|
|
|
<GroupSection key={group.name} group={group} groupIndex={groupIndex} />
|
2026-08-17 13:49:55 +02:00
|
|
|
))}
|
|
|
|
|
</main>
|
|
|
|
|
);
|
|
|
|
|
}
|