"use client"; import Link from "next/link"; import { useActionState } from "react"; import { kundeSpeichern, type AktionsErgebnis } from "@/server/actions/kunden"; export interface KundeFormularWerte { id?: string; name: string; kundennummer: string; ansprechpartner: string | null; email: string | null; telefon: string | null; eigenbedarf: boolean; notizen: string | null; } const LEER: AktionsErgebnis = {}; export function KundeFormular({ werte }: { werte?: KundeFormularWerte }) { const [ergebnis, aktion, laeuft] = useActionState(kundeSpeichern, LEER); function feldKlasse(feld: string) { return `form-control ${ergebnis.felder?.[feld] ? "is-invalid" : ""}`; } return (
); }