2323 {{ document.totalPages }}
2424 </template >
2525 </NcListItem >
26- <NcListItem v-if = " document.size " class =" extra" compact >
26+ <NcListItem class =" extra" compact >
2727 <template #name >
2828 <strong >{{ t('libresign', 'File size:') }}</strong >
2929 {{ size }}
@@ -68,26 +68,17 @@ import {
6868import { getStatusLabel } from ' ../../utils/fileStatus.js'
6969import { openDocument } from ' ../../utils/viewer.js'
7070import SignerDetails from ' ./SignerDetails.vue'
71- import type { SignerDetailRecord , SignerSummaryRecord } from ' ../../types/index'
71+ import type {
72+ LoadedValidationFileDocument ,
73+ ValidatedChildFileRecord ,
74+ } from ' ../../types/index'
7275
7376defineOptions ({
7477 name: ' DocumentValidationDetails' ,
7578})
7679
77- type ValidationSigner = Partial <SignerSummaryRecord | SignerDetailRecord >
78- type ValidationDocument = {
79- uuid? : string
80- name? : string
81- nodeId? : number
82- totalPages? : number
83- pdfVersion? : string
84- status? : string | number
85- size? : string | number
86- signers? : ValidationSigner []
87- }
88-
8980const props = withDefaults (defineProps <{
90- document: ValidationDocument
81+ document: LoadedValidationFileDocument | ValidatedChildFileRecord
9182 legalInformation? : string
9283 documentValidMessage? : string
9384 isAfterSigned? : boolean
@@ -100,11 +91,9 @@ const props = withDefaults(defineProps<{
10091const { document } = toRefs (props )
10192
10293const size = computed (() => {
103- if (! document .value .size ) return ' '
104- const parsedSize = parseInt (String (document .value .size ), 10 )
105- if (parsedSize < 1024 ) return parsedSize + ' B'
106- if (parsedSize < 1048576 ) return (parsedSize / 1024 ).toFixed (2 ) + ' KB'
107- return (parsedSize / 1048576 ).toFixed (2 ) + ' MB'
94+ if (document .value .size < 1024 ) return document .value .size + ' B'
95+ if (document .value .size < 1048576 ) return (document .value .size / 1024 ).toFixed (2 ) + ' KB'
96+ return (document .value .size / 1048576 ).toFixed (2 ) + ' MB'
10897})
10998
11099const documentStatus = computed (() => getStatusLabel (document .value .status ))
0 commit comments