diff --git a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/DocumentPageClient.tsx b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/DocumentPageClient.tsx index 8f5bf75..b28a615 100644 --- a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/DocumentPageClient.tsx +++ b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/DocumentPageClient.tsx @@ -23,15 +23,35 @@ export function DocumentPageClient({ clientPropertyAddress, }: DocumentPageClientProps) { const [previewToken, setPreviewToken] = useState(null); + const [selectedFieldId, setSelectedFieldId] = useState(null); + const [textFillData, setTextFillData] = useState>({}); const handleFieldsChanged = useCallback(() => { setPreviewToken(null); }, []); + const handleFieldValueChange = useCallback((fieldId: string, value: string) => { + setTextFillData(prev => ({ ...prev, [fieldId]: value })); + setPreviewToken(null); // TXTF-03: reset staleness on any text value change + }, []); + + const handleQuickFill = useCallback((fieldId: string, value: string) => { + setTextFillData(prev => ({ ...prev, [fieldId]: value })); + setPreviewToken(null); // TXTF-03: reset staleness on quick fill + }, []); + return (
- +