@@ -8,6 +8,20 @@ interface OriginalReportProps {
88}
99
1010const OriginalReport : React . FC < OriginalReportProps > = ( { reportData } ) => {
11+ // Function to format file size in KB or MB
12+ const formatFileSize = ( bytes : number ) : string => {
13+ if ( bytes < 1024 ) return bytes + ' B' ;
14+ else if ( bytes < 1048576 ) return Math . round ( bytes / 1024 ) + ' KB' ;
15+ else return ( bytes / 1048576 ) . toFixed ( 1 ) + ' MB' ;
16+ } ;
17+
18+ // Get filename from originalFilename or fall back to file path
19+ const filename =
20+ reportData . originalFilename || reportData . filePath . split ( '/' ) . pop ( ) || 'Unknown file' ;
21+
22+ // Format file size if available
23+ const fileSize = reportData . fileSize ? formatFileSize ( reportData . fileSize ) : 'Unknown size' ;
24+
1125 return (
1226 < div className = "report-detail-page__original-report" >
1327 { /* Test results table */ }
@@ -45,6 +59,12 @@ const OriginalReport: React.FC<OriginalReportProps> = ({ reportData }) => {
4559 ) ) }
4660 </ div >
4761
62+ { /* Medical Comments Section */ }
63+ < div className = "report-detail-page__comments-section" >
64+ < h4 className = "report-detail-page__comments-title" > Medical Comments:</ h4 >
65+ < div className = "report-detail-page__comments-text" > { reportData . summary } </ div >
66+ </ div >
67+
4868 { /* Uploaded File Section */ }
4969 < div className = "report-detail-page__uploaded-file" >
5070 < h4 className = "report-detail-page__uploaded-file-title" > Uploaded file</ h4 >
@@ -53,11 +73,9 @@ const OriginalReport: React.FC<OriginalReportProps> = ({ reportData }) => {
5373 < Icon icon = "filePdf" />
5474 </ div >
5575 < div className = "report-detail-page__file-details" >
56- < div className = "report-detail-page__file-name" >
57- { reportData . filePath . split ( '/' ) . pop ( ) || 'Exam_11_01_2024.pdf' }
58- </ div >
76+ < div className = "report-detail-page__file-name" > { filename } </ div >
5977 < div className = "report-detail-page__file-info" >
60- < span className = "report-detail-page__file-size" > 92 kb </ span >
78+ < span className = "report-detail-page__file-size" > { fileSize } </ span >
6179 < span className = "report-detail-page__file-separator" > •</ span >
6280 < span className = "report-detail-page__file-date" >
6381 Uploaded ({ format ( new Date ( reportData . createdAt ) , 'MM/dd/yyyy' ) } )
0 commit comments