Expert bewerken
{errorMsg &&{errorMsg}
}import Link from "next/link"; import { notFound } from "next/navigation"; import { requireAdmin } from "../../../lib/auth"; import { listRikxRondes } from "../../../lib/db"; import { getExpert } from "../../../lib/experts"; import { AppHeader } from "../../AppHeader"; import { updateExpert } from "../actions"; import { RondeCheckboxes } from "../InviteForms"; export default async function EditExpertPage({ params, searchParams, }: { params: Promise<{ id: string }>; searchParams: Promise<{ error?: string }>; }) { const session = await requireAdmin(); const { id } = await params; const { error } = await searchParams; const expert = getExpert(Number(id)); if (!expert) notFound(); const errorMsg = error === "email" ? "Er bestaat al een gebruiker met dit e-mailadres." : error === "missing" ? "Vul een naam en een geldig e-mailadres in." : null; const inputClass = "h-10 rounded-lg border border-zinc-300 dark:border-zinc-700 bg-white dark:bg-zinc-800 px-3 text-sm text-zinc-900 dark:text-zinc-100 focus:outline-none focus:ring-2 focus:ring-rikx-orange"; return (
{errorMsg}
}