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: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">
|
|
|
|
|
<header className="flex items-center justify-between">
|
|
|
|
|
<h1 className="text-lg font-semibold text-fg">{config.settings.title}</h1>
|
|
|
|
|
</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>
|
|
|
|
|
);
|
|
|
|
|
}
|