1
0
Fork 0
fahrPool/web/app/dashboard/page.tsx

24 lines
887 B
TypeScript

import { loadProfile } from "@/lib/auth/profile";
import { listAuftraegeFuerKanban, listFahrerNutzer } from "@/lib/dashboard/queries";
import { KanbanBoard } from "@/components/dashboard/KanbanBoard";
export default async function DashboardPage() {
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-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>
);
}