@@ -44,10 +44,23 @@ interface PdfViewerProps {
4444 isPendingApproval : boolean ;
4545 /** Whether the current version is read-only (published or pending) */
4646 isVersionReadOnly ?: boolean ;
47+ /** Whether viewing the currently active/published version */
48+ isViewingActiveVersion ?: boolean ;
49+ /** Whether viewing a version pending approval */
50+ isViewingPendingVersion ?: boolean ;
4751 onMutate ?: ( ) => void ;
4852}
4953
50- export function PdfViewer ( { policyId, versionId, pdfUrl, isPendingApproval, isVersionReadOnly = false , onMutate } : PdfViewerProps ) {
54+ export function PdfViewer ( {
55+ policyId,
56+ versionId,
57+ pdfUrl,
58+ isPendingApproval,
59+ isVersionReadOnly = false ,
60+ isViewingActiveVersion = false ,
61+ isViewingPendingVersion = false ,
62+ onMutate
63+ } : PdfViewerProps ) {
5164 // Combine both checks - can't modify if pending approval OR version is read-only
5265 const isReadOnly = isPendingApproval || isVersionReadOnly ;
5366 const router = useRouter ( ) ;
@@ -269,7 +282,13 @@ export function PdfViewer({ policyId, versionId, pdfUrl, isPendingApproval, isVe
269282 < div className = "space-y-4" >
270283 { isVersionReadOnly && pdfUrl && (
271284 < div className = "flex items-center gap-4 rounded-lg border border-primary/20 bg-primary/10 px-4 py-3 text-sm text-foreground" >
272- < span > This version is published. Create a new version to make changes.</ span >
285+ < span >
286+ { isViewingPendingVersion
287+ ? 'This version is pending approval and cannot be edited.'
288+ : isViewingActiveVersion
289+ ? 'This version is published. Create a new version to make changes.'
290+ : 'This version cannot be edited.' }
291+ </ span >
273292 </ div >
274293 ) }
275294 { pdfUrl ? (
0 commit comments