import { redirect } from "next/navigation"; import { loadProfile } from "@/lib/auth/profile"; import { kannStammdatenPflegen } from "@/lib/auth/roles"; import { listFahrzeuge } from "@/lib/auftraege/queries"; import { FahrzeugeTabelle } from "@/components/fahrzeuge/FahrzeugeTabelle"; export default async function FahrzeugePage() { const profileResult = await loadProfile(); if (profileResult.status !== "ok" || !kannStammdatenPflegen(profileResult.profile.role)) { redirect(`/auftraege?error=${encodeURIComponent("Nur Disponent/Admin duerfen Stammdaten pflegen.")}`); } const fahrzeuge = await listFahrzeuge(); return (

Fahrzeuge

); }