Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 02:14:41 +00:00
co-authored by renee-png
parent f19a4454b1
commit 45432d77d6
@@ -32,14 +32,20 @@ export function FormFieldsFillPanel({
}) {
const [clients, setClients] = useState<ClientLite[]>([]);
const [homeownersByClient, setHomeownersByClient] = useState<Record<string, HomeownerLite[]>>({});
const [contacts, setContacts] = useState<ContactLite[]>([]);
// Track which client a homeowner field is filtered by (per-field-key)
const [hoClientByField, setHoClientByField] = useState<Record<string, string>>({});
// Track which contact id is selected per contact-field-key
const [contactIdByField, setContactIdByField] = useState<Record<string, string>>({});
useEffect(() => {
if (fields.some((f) => f.type === "client" || f.type === "homeowner")) {
fetchClients().then(setClients);
}
if (fields.some((f) => f.type === "contact")) {
fetchContacts().then(setContacts);
}
}, [fields]);
const set = (key: string, v: string) => onChange({ ...values, [key]: v });