diff --git a/frontend/src/pages/Reports/components/AiAnalysisTab.tsx b/frontend/src/pages/Reports/components/AiAnalysisTab.tsx index fe6217cc..302ce02c 100644 --- a/frontend/src/pages/Reports/components/AiAnalysisTab.tsx +++ b/frontend/src/pages/Reports/components/AiAnalysisTab.tsx @@ -4,6 +4,7 @@ import EmergencyAlert from './EmergencyAlert'; import FlaggedValuesSection from './FlaggedValuesSection'; import NormalValuesSection from './NormalValuesSection'; import LowConfidenceNotice from './LowConfidenceNotice'; +import AiAssistantNotice from './AiAssistantNotice'; interface AiAnalysisTabProps { reportData: MedicalReport; @@ -59,6 +60,9 @@ const AiAnalysisTab: React.FC = ({ isExpanded={normalValuesExpanded} onToggle={toggleNormalValues} /> + + {/* AI Assistant Notice */} + ); }; diff --git a/frontend/src/pages/Reports/components/AiAssistantNotice.scss b/frontend/src/pages/Reports/components/AiAssistantNotice.scss new file mode 100644 index 00000000..8f1af6ca --- /dev/null +++ b/frontend/src/pages/Reports/components/AiAssistantNotice.scss @@ -0,0 +1,28 @@ +.ai-assistant-notice { + padding: 20px 0; + display: flex; + justify-content: center; + + &__content { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + } + + .clarification-text { + font-size: 15px; + margin-bottom: 8px; + } + + .assistant-link { + color: #6177FF; + font-size: 15px; + cursor: pointer; + font-weight: 500; + + &:hover { + text-decoration: underline; + } + } +} \ No newline at end of file diff --git a/frontend/src/pages/Reports/components/AiAssistantNotice.tsx b/frontend/src/pages/Reports/components/AiAssistantNotice.tsx new file mode 100644 index 00000000..a6bb3643 --- /dev/null +++ b/frontend/src/pages/Reports/components/AiAssistantNotice.tsx @@ -0,0 +1,40 @@ +import React, { useState } from 'react'; +import { IonText } from '@ionic/react'; +import AIAssistantModal from '../../../common/components/AIAssistant/AIAssistantModal'; +import './AiAssistantNotice.scss'; + +/** + * Component to display an AI Assistant notice with a link to open the AI Chat modal. + */ +const AiAssistantNotice: React.FC = () => { + const [isAIAssistantOpen, setIsAIAssistantOpen] = useState(false); + + const handleOpenAIAssistant = () => { + setIsAIAssistantOpen(true); + }; + + return ( +
+
+ + Still need further clarifications? + + +
+ Ask our AI Assistant > +
+
+ + +
+ ); +}; + +export default AiAssistantNotice; \ No newline at end of file diff --git a/frontend/src/pages/Reports/components/OriginalReport.tsx b/frontend/src/pages/Reports/components/OriginalReport.tsx deleted file mode 100644 index a9df4735..00000000 --- a/frontend/src/pages/Reports/components/OriginalReport.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import React from 'react'; -import { format } from 'date-fns'; -import Icon from '../../../common/components/Icon/Icon'; -import { MedicalReport } from '../../../common/models/medicalReport'; - -interface OriginalReportTabProps { - reportData: MedicalReport; -} - -const OriginalReportTab: React.FC = ({ reportData }) => { - // Function to format file size in KB or MB - const formatFileSize = (bytes: number): string => { - if (bytes < 1024) return bytes + ' B'; - else if (bytes < 1048576) return Math.round(bytes / 1024) + ' KB'; - else return (bytes / 1048576).toFixed(1) + ' MB'; - }; - - // Get filename from originalFilename or fall back to file path - const filename = - reportData.originalFilename || reportData.filePath.split('/').pop() || 'Unknown file'; - - // Format file size if available - const fileSize = reportData.fileSize ? formatFileSize(reportData.fileSize) : 'Unknown size'; - - return ( -
- {/* Test results table */} -
-
-
- Test -
-
- Results -
-
- Ref. -
-
- - {/* Test Results Rows */} - {reportData.labValues.map((labValue, index) => ( -
-
- {labValue.name} -
-
- {labValue.value} {labValue.unit} -
-
- {labValue.normalRange} -
-
- ))} -
- - {/* Medical Comments Section */} -
-

Medical Comments:

-
{reportData.summary}
-
- - {/* Uploaded File Section */} -
-

Uploaded file

-
-
- -
-
-
{filename}
-
- {fileSize} - - - Uploaded ({format(new Date(reportData.createdAt), 'MM/dd/yyyy')}) - -
-
-
-
-
- ); -}; - -export default OriginalReportTab; diff --git a/frontend/src/pages/Upload/__tests__/UploadPage.test.tsx b/frontend/src/pages/Upload/__tests__/UploadPage.test.tsx index f27ed2b7..960ecca4 100644 --- a/frontend/src/pages/Upload/__tests__/UploadPage.test.tsx +++ b/frontend/src/pages/Upload/__tests__/UploadPage.test.tsx @@ -55,7 +55,7 @@ vi.mock('common/components/Upload/UploadModal', () => { bookmarked: false, processingStatus: ProcessingStatus.PROCESSED, labValues: [], - summary: 'Test report summary', + medicalComments: 'Test report medical comments', filePath: '/reports/test-report.pdf', originalFilename: 'test-report.pdf', fileSize: 1024,