diff --git a/web/app/nutzerverwaltung/page.tsx b/web/app/nutzerverwaltung/page.tsx index ed7fbd6..0bdc913 100644 --- a/web/app/nutzerverwaltung/page.tsx +++ b/web/app/nutzerverwaltung/page.tsx @@ -2,14 +2,14 @@ import { redirect } from "next/navigation"; import { loadProfile } from "@/lib/auth/profile"; import { canManageUsers } from "@/lib/auth/roles"; import { listNutzer } from "@/lib/nutzerverwaltung/queries"; -import { erstelleNutzer, aendereRolle, sperreNutzer, entsperreNutzer } from "./actions"; +import { GUELTIGE_ROLLEN } from "@/lib/nutzerverwaltung/validate-nutzer"; +import { erstelleNutzer } from "./actions"; +import { NutzerTabelle } from "@/components/nutzerverwaltung/NutzerTabelle"; import { Card } from "@/components/ui/Card"; import { Button } from "@/components/ui/Button"; import { Alert } from "@/components/ui/Alert"; import { FormField, FIELD_CLASSES } from "@/components/ui/FormField"; -const ROLLEN_OPTIONEN = ["admin", "disponent", "fahrer", "readonly"] as const; - export default async function NutzerverwaltungPage({ searchParams, }: { @@ -24,7 +24,7 @@ export default async function NutzerverwaltungPage({ const nutzerListe = await listNutzer(); return ( -
+

Nutzerverwaltung

{error && ( @@ -34,52 +34,7 @@ export default async function NutzerverwaltungPage({ )}
-
    - {nutzerListe.map((nutzer) => { - const istEigenerAccount = nutzer.id === profileResult.profile.id; - const aendereRolleAction = aendereRolle.bind(null, nutzer.id); - const sperrenAction = sperreNutzer.bind(null, nutzer.id); - const entsperrenAction = entsperreNutzer.bind(null, nutzer.id); - - return ( -
  • - -

    - {nutzer.name} {nutzer.email ? `(${nutzer.email})` : ""} - {nutzer.gesperrt && Gesperrt} -

    -
    - - -
    -
    - -
    -
    -
  • - ); - })} -
+
@@ -96,7 +51,7 @@ export default async function NutzerverwaltungPage({