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:
@@ -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,6 +57,7 @@ export function PdfViewer({ docId, docStatus }: { docId: string; docStatus?: str
|
|||||||
>
|
>
|
||||||
Zoom Out
|
Zoom Out
|
||||||
</button>
|
</button>
|
||||||
|
{docStatus !== 'Signed' && (
|
||||||
<a
|
<a
|
||||||
href={`/api/documents/${docId}/file`}
|
href={`/api/documents/${docId}/file`}
|
||||||
download
|
download
|
||||||
@@ -64,6 +65,7 @@ export function PdfViewer({ docId, docStatus }: { docId: string; docStatus?: str
|
|||||||
>
|
>
|
||||||
Download
|
Download
|
||||||
</a>
|
</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 */}
|
||||||
|
|||||||
Reference in New Issue
Block a user