/** * AddressFieldset * * Reusable controlled fieldset for the domain Address type. Pure presentation: * renders labeled inputs for street / zip / city / country and bubbles changes * via onChange(next). The parent owns the value and any save logic, which is * why this component is decoupled from any mutation / edit-toggle concerns. * * Consumed by: * - CompanySettingsPage (inside the big company form) * - PersonalAddressSection (dedicated personal-account edit surface) * * (c) 2026 TWWIM UG. All rights reserved. (www.twwim.com) */ import type { Address } from '@archer/domain'; import { CurrencyResolver, Channel } from '@archer/domain'; import { useTranslation } from '@/i18n/TranslationProvider'; import { CountrySelect } from '@archer/ui/components'; interface Props { value: Address; onChange: (next: Address) => void; disabled?: boolean; /** When true, render a red asterisk after each visible label to mark the * fields as Pflichtangaben. The component itself does not enforce * required at HTML level — the parent form decides validation. */ required?: boolean; /** Override input class to match host styling if needed. */ inputClassName?: string; } const DEFAULT_INPUT_CLASS = 'w-full px-3 py-2.5 border border-border rounded-lg bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary/50'; export function AddressFieldset({ value, onChange, disabled, required, inputClassName }: Props) { const { t } = useTranslation(); const cls = inputClassName ?? DEFAULT_INPUT_CLASS; const patch = (p: Partial
) => onChange({ ...value, ...p }); const star = required ? * : null; return ( <>