forked from fahrPool/fahrPool
22 lines
814 B
TypeScript
22 lines
814 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { loadProfile } from "@/lib/auth/profile";
|
|
import { kannStammdatenPflegen } from "@/lib/auth/roles";
|
|
import { listOrte } from "@/lib/auftraege/queries";
|
|
import { StandorteTabelle } from "@/components/standorte/StandorteTabelle";
|
|
|
|
export default async function StandortePage() {
|
|
const profileResult = await loadProfile();
|
|
if (profileResult.status !== "ok" || !kannStammdatenPflegen(profileResult.profile.role)) {
|
|
redirect(`/auftraege?error=${encodeURIComponent("Nur Disponent/Admin duerfen Stammdaten pflegen.")}`);
|
|
}
|
|
|
|
const orte = await listOrte();
|
|
|
|
return (
|
|
<div className="mx-auto max-w-4xl p-4 md:p-8">
|
|
<h1 className="mb-6 text-xl font-semibold text-asphalt-grey">Standorte</h1>
|
|
<StandorteTabelle orte={orte} />
|
|
</div>
|
|
);
|
|
}
|