1
0
Fork 0

feat: wire Kanban board into the dashboard page

This commit is contained in:
Jonny 2026-07-08 08:21:13 +02:00
parent affa6961ab
commit a82e31d75e
1 changed files with 13 additions and 11 deletions

View File

@ -1,21 +1,23 @@
import { loadProfile } from "@/lib/auth/profile";
import { Card } from "@/components/ui/Card";
import { listAuftraegeFuerKanban, listFahrerNutzer } from "@/lib/dashboard/queries";
import { KanbanBoard } from "@/components/dashboard/KanbanBoard";
export default async function DashboardPage() {
const result = await loadProfile();
if (result.status !== "ok") {
const profileResult = await loadProfile();
if (profileResult.status !== "ok") {
return null;
}
const kannZuweisen = profileResult.profile.role === "admin" || profileResult.profile.role === "disponent";
const [spalten, fahrerListe] = await Promise.all([
listAuftraegeFuerKanban(),
kannZuweisen ? listFahrerNutzer() : Promise.resolve([]),
]);
return (
<div className="mx-auto max-w-2xl p-4 md:p-8">
<Card>
<h1 className="text-xl font-semibold text-asphalt-grey">Dashboard</h1>
<p className="mt-2 text-asphalt-grey">
Eingeloggt als {result.profile.name} ({result.profile.role})
</p>
</Card>
<div className="mx-auto max-w-6xl p-4 md:p-8">
<h1 className="mb-6 text-xl font-semibold text-asphalt-grey">Dashboard</h1>
<KanbanBoard initialSpalten={spalten} fahrerListe={fahrerListe} rolle={profileResult.profile.role} />
</div>
);
}