"use client" import { useActionState, useEffect, useState } from "react"; import { Field, FieldGroup, FieldLabel } from "@/components/ui/field"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { saveStammdaten, StammdatenState } from "@/modules/shared/actions/stammdaten"; import { Building2, CreditCard, FileText, MapPin, User, type LucideIcon, } from "lucide-react"; import { LEGAL_FORMS } from "@/modules/shared/data/stammdaten-data"; type Client = { company_name: string; legal_form: string; industry: string | null; vat_id: string | null; tax_number: string | null; commercial_register_number: string | null; street: string; postal_code: string; city: string; country: string; billing_street: string | null; billing_postal_code: string | null; billing_city: string | null; billing_country: string | null; contact_name: string; contact_position: string | null; contact_email: string; contact_phone: string | null; } | null; type PaymentDetails = { payment_method: "invoice" | "sepa_debit" | "card"; account_holder: string | null; iban: string | null; bic: string | null; } | null; const selectClassName = "flex h-10 w-full rounded-md border border-input bg-background px-3 text-body outline-none transition-colors placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50"; function FormSection({ icon: Icon, title, children, }: { icon: LucideIcon; title: string; children: React.ReactNode; }) { return (