fix(07-04): hide Download anchor in PdfViewer for Signed documents (LEGAL-03)

- Wrap Download anchor in conditional: only rendered when docStatus !== 'Signed'
- PDF viewer still loads original via /file for in-browser display regardless of status
- PreparePanel presigned URL remains sole download path for signed PDFs
This commit is contained in:
Chandler Copeland
2026-03-21 10:54:43 -06:00
parent 6775cc76eb
commit cac5d5bbb6

View File

@@ -25,7 +25,7 @@ export function PdfViewer({ docId, docStatus }: { docId: string; docStatus?: str
const [scale, setScale] = useState(1.0); const [scale, setScale] = useState(1.0);
const [pageInfo, setPageInfo] = useState<PageInfo | null>(null); const [pageInfo, setPageInfo] = useState<PageInfo | null>(null);
const readOnly = docStatus === 'Sent' || docStatus === 'Signed'; const readOnly = docStatus !== 'Draft';
return ( return (
<div className="flex flex-col items-center gap-4"> <div className="flex flex-col items-center gap-4">
@@ -57,13 +57,15 @@ export function PdfViewer({ docId, docStatus }: { docId: string; docStatus?: str
> >
Zoom Out Zoom Out
</button> </button>
<a {docStatus !== 'Signed' && (
href={`/api/documents/${docId}/file`} <a
download href={`/api/documents/${docId}/file`}
className="px-3 py-1 border rounded hover:bg-gray-100" download
> className="px-3 py-1 border rounded hover:bg-gray-100"
Download >
</a> Download
</a>
)}
</div> </div>
{/* PDF canvas wrapped in FieldPlacer for drag-and-drop field placement */} {/* PDF canvas wrapped in FieldPlacer for drag-and-drop field placement */}