diff --git a/src/components/forms/form-fields-fill-panel.tsx b/src/components/forms/form-fields-fill-panel.tsx index cfbb86d..acf9316 100644 --- a/src/components/forms/form-fields-fill-panel.tsx +++ b/src/components/forms/form-fields-fill-panel.tsx @@ -32,14 +32,20 @@ export function FormFieldsFillPanel({ }) { const [clients, setClients] = useState([]); const [homeownersByClient, setHomeownersByClient] = useState>({}); + const [contacts, setContacts] = useState([]); // Track which client a homeowner field is filtered by (per-field-key) const [hoClientByField, setHoClientByField] = useState>({}); + // Track which contact id is selected per contact-field-key + const [contactIdByField, setContactIdByField] = useState>({}); 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 });