From 45432d77d64d372119b4bf4a4de9eb7df868265d Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 02:14:41 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/components/forms/form-fields-fill-panel.tsx | 6 ++++++ 1 file changed, 6 insertions(+) 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 });