diff --git a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/FieldPlacer.tsx b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/FieldPlacer.tsx index aeb766d..89d4172 100644 --- a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/FieldPlacer.tsx +++ b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/FieldPlacer.tsx @@ -13,7 +13,7 @@ import { } from '@dnd-kit/core'; import { CSS } from '@dnd-kit/utilities'; import { getFieldType, type SignatureFieldType } from '@/lib/db/schema'; -import type { SignatureFieldData } from '@/lib/db/schema'; +import type { SignatureFieldData, DocumentSigner } from '@/lib/db/schema'; interface PageInfo { originalWidth: number; @@ -164,9 +164,11 @@ interface FieldPlacerProps { onFieldSelect?: (fieldId: string | null) => void; onFieldValueChange?: (fieldId: string, value: string) => void; aiPlacementKey?: number; + signers?: DocumentSigner[]; + unassignedFieldIds?: Set; } -export function FieldPlacer({ docId, pageInfo, currentPage, children, readOnly = false, onFieldsChanged, selectedFieldId, textFillData, onFieldSelect, onFieldValueChange, aiPlacementKey = 0 }: FieldPlacerProps) { +export function FieldPlacer({ docId, pageInfo, currentPage, children, readOnly = false, onFieldsChanged, selectedFieldId, textFillData, onFieldSelect, onFieldValueChange, aiPlacementKey = 0, signers = [], unassignedFieldIds = new Set() }: FieldPlacerProps) { const [fields, setFields] = useState([]); const [isDraggingToken, setIsDraggingToken] = useState(null); const containerRef = useRef(null); diff --git a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/PdfViewer.tsx b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/PdfViewer.tsx index c3dceb9..37f3005 100644 --- a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/PdfViewer.tsx +++ b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/_components/PdfViewer.tsx @@ -4,6 +4,7 @@ import { Document, Page, pdfjs } from 'react-pdf'; import 'react-pdf/dist/Page/AnnotationLayer.css'; import 'react-pdf/dist/Page/TextLayer.css'; import { FieldPlacer } from './FieldPlacer'; +import type { DocumentSigner } from '@/lib/db/schema'; // Worker setup — must use import.meta.url for local/Docker environments (no CDN) pdfjs.GlobalWorkerOptions.workerSrc = new URL( @@ -28,6 +29,8 @@ export function PdfViewer({ onFieldSelect, onFieldValueChange, aiPlacementKey, + signers, + unassignedFieldIds, }: { docId: string; docStatus?: string; @@ -37,6 +40,8 @@ export function PdfViewer({ onFieldSelect?: (fieldId: string | null) => void; onFieldValueChange?: (fieldId: string, value: string) => void; aiPlacementKey?: number; + signers?: DocumentSigner[]; + unassignedFieldIds?: Set; }) { const [numPages, setNumPages] = useState(0); const [pageNumber, setPageNumber] = useState(1); @@ -98,6 +103,8 @@ export function PdfViewer({ onFieldSelect={onFieldSelect} onFieldValueChange={onFieldValueChange} aiPlacementKey={aiPlacementKey} + signers={signers} + unassignedFieldIds={unassignedFieldIds} > import('./PdfViewer').then(m => m.PdfViewer), { ssr: false }); @@ -12,6 +13,8 @@ export function PdfViewerWrapper({ onFieldSelect, onFieldValueChange, aiPlacementKey, + signers, + unassignedFieldIds, }: { docId: string; docStatus?: string; @@ -21,6 +24,8 @@ export function PdfViewerWrapper({ onFieldSelect?: (fieldId: string | null) => void; onFieldValueChange?: (fieldId: string, value: string) => void; aiPlacementKey?: number; + signers?: DocumentSigner[]; + unassignedFieldIds?: Set; }) { return ( ); }