diff --git a/src/app/v/_components/vendor-portal-documents.tsx b/src/app/v/_components/vendor-portal-documents.tsx index 204d8092..5ebc1538 100644 --- a/src/app/v/_components/vendor-portal-documents.tsx +++ b/src/app/v/_components/vendor-portal-documents.tsx @@ -21,6 +21,64 @@ type VendorPortalDocumentsProps = { onChanged: () => Promise; }; +type VendorPortalDocumentRowProps = { + document: VendorPortalDocument; + locked: boolean; + uploading: boolean; + onDownload: () => void; + onReplace: () => void; +}; + +function VendorPortalDocumentRow({ + document, + locked, + uploading, + onDownload, + onReplace, +}: VendorPortalDocumentRowProps) { + return ( +
+
+ File + + {document.originalFileName} · v{document.version} + +
+
+ Security scan + {document.scanStatus} +
+
+ Review + {document.reviewStatus} +
+ {Boolean(document.rejectionReason) && ( + {document.rejectionReason} + )} +
+ + {!locked && ( + + )} +
+
+ ); +} + type UploadRequest = { file: File; replacementId?: number; @@ -112,45 +170,14 @@ export function VendorPortalDocuments({ )} {documents.map((document) => ( -
-
- File - - {document.originalFileName} · v{document.version} - -
-
- Security scan - {document.scanStatus} -
-
- Review - {document.reviewStatus} -
- {Boolean(document.rejectionReason) && ( - {document.rejectionReason} - )} -
- - {!locked && ( - - )} -
-
+ void vendorPortalApi.downloadDocument(token, dispatchId, document)} + onReplace={() => chooseFile(document.id)} + /> ))} {progress !== undefined && (