diff --git a/frontend/src/pages/ReportDetail/components/AiAnalysisTab.tsx b/frontend/src/pages/ReportDetail/components/AiAnalysisTab.tsx
index fe6217cc..702dd04c 100644
--- a/frontend/src/pages/ReportDetail/components/AiAnalysisTab.tsx
+++ b/frontend/src/pages/ReportDetail/components/AiAnalysisTab.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import { FC, useState } from 'react';
import { MedicalReport, LabValue } from '../../../common/models/medicalReport';
import EmergencyAlert from './EmergencyAlert';
import FlaggedValuesSection from './FlaggedValuesSection';
@@ -10,13 +10,10 @@ interface AiAnalysisTabProps {
isEmergencyAlertVisible?: boolean;
}
-const AiAnalysisTab: React.FC
= ({
- reportData,
- isEmergencyAlertVisible = true,
-}) => {
+const AiAnalysisTab: FC = ({ reportData, isEmergencyAlertVisible = true }) => {
// State to track expanded sections
- const [flaggedValuesExpanded, setFlaggedValuesExpanded] = React.useState(true);
- const [normalValuesExpanded, setNormalValuesExpanded] = React.useState(true);
+ const [flaggedValuesExpanded, setFlaggedValuesExpanded] = useState(true);
+ const [normalValuesExpanded, setNormalValuesExpanded] = useState(true);
// Toggle expanded state of sections
const toggleFlaggedValues = () => setFlaggedValuesExpanded(!flaggedValuesExpanded);
diff --git a/frontend/src/pages/ReportDetail/components/AiAssistantNotice.tsx b/frontend/src/pages/ReportDetail/components/AiAssistantNotice.tsx
index f257a1b3..918690d8 100644
--- a/frontend/src/pages/ReportDetail/components/AiAssistantNotice.tsx
+++ b/frontend/src/pages/ReportDetail/components/AiAssistantNotice.tsx
@@ -1,4 +1,4 @@
-import React, { useState } from 'react';
+import { FC, useState } from 'react';
import { IonText } from '@ionic/react';
import AIAssistantModal from '../../../common/components/AIAssistant/AIAssistantModal';
import './AiAssistantNotice.scss';
@@ -6,7 +6,7 @@ import './AiAssistantNotice.scss';
/**
* Component to display an AI Assistant notice with a link to open the AI Chat modal.
*/
-const AiAssistantNotice: React.FC = () => {
+const AiAssistantNotice: FC = () => {
const [isAIAssistantOpen, setIsAIAssistantOpen] = useState(false);
const handleOpenAIAssistant = () => {
diff --git a/frontend/src/pages/ReportDetail/components/EmergencyAlert.tsx b/frontend/src/pages/ReportDetail/components/EmergencyAlert.tsx
index 1c63ce20..595ff265 100644
--- a/frontend/src/pages/ReportDetail/components/EmergencyAlert.tsx
+++ b/frontend/src/pages/ReportDetail/components/EmergencyAlert.tsx
@@ -1,8 +1,8 @@
-import React from 'react';
+import { FC } from 'react';
import { useTranslation } from 'react-i18next';
import redAlertIcon from 'assets/icons/red-alert.svg';
-const EmergencyAlert: React.FC = () => {
+const EmergencyAlert: FC = () => {
const { t } = useTranslation();
return (
diff --git a/frontend/src/pages/ReportDetail/components/FlaggedValuesSection.tsx b/frontend/src/pages/ReportDetail/components/FlaggedValuesSection.tsx
index 6ab131b9..305d200e 100644
--- a/frontend/src/pages/ReportDetail/components/FlaggedValuesSection.tsx
+++ b/frontend/src/pages/ReportDetail/components/FlaggedValuesSection.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import { FC } from 'react';
import { useTranslation } from 'react-i18next';
import Icon from '../../../common/components/Icon/Icon';
import { LabValue } from '../../../common/models/medicalReport';
@@ -11,7 +11,7 @@ interface FlaggedValuesSectionProps {
onToggle: () => void;
}
-const FlaggedValuesSection: React.FC = ({
+const FlaggedValuesSection: FC = ({
flaggedValues,
isExpanded,
onToggle,
diff --git a/frontend/src/pages/ReportDetail/components/InfoCard.tsx b/frontend/src/pages/ReportDetail/components/InfoCard.tsx
index 328b85bc..3ca4024f 100644
--- a/frontend/src/pages/ReportDetail/components/InfoCard.tsx
+++ b/frontend/src/pages/ReportDetail/components/InfoCard.tsx
@@ -1,8 +1,8 @@
-import React from 'react';
+import { FC } from 'react';
import './InfoCard.scss';
import bulbIcon from '../../../assets/icons/bulb.svg';
-const InfoCard: React.FC = () => {
+const InfoCard: FC = () => {
return (
diff --git a/frontend/src/pages/ReportDetail/components/LabValueItem.tsx b/frontend/src/pages/ReportDetail/components/LabValueItem.tsx
index 0594a314..1f399998 100644
--- a/frontend/src/pages/ReportDetail/components/LabValueItem.tsx
+++ b/frontend/src/pages/ReportDetail/components/LabValueItem.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import { FC } from 'react';
import { useTranslation } from 'react-i18next';
import { LabValue } from '../../../common/models/medicalReport';
import classNames from 'classnames';
@@ -7,7 +7,7 @@ interface LabValueItemProps {
item: LabValue;
}
-const LabValueItem: React.FC
= ({ item }) => {
+const LabValueItem: FC = ({ item }) => {
const { t } = useTranslation();
// Parse suggestions into bullet points more intelligently
diff --git a/frontend/src/pages/ReportDetail/components/LowConfidenceNotice.tsx b/frontend/src/pages/ReportDetail/components/LowConfidenceNotice.tsx
index c7f5615c..399d4f36 100644
--- a/frontend/src/pages/ReportDetail/components/LowConfidenceNotice.tsx
+++ b/frontend/src/pages/ReportDetail/components/LowConfidenceNotice.tsx
@@ -1,11 +1,11 @@
-import React from 'react';
+import { FC } from 'react';
import { useTranslation } from 'react-i18next';
import info from '../../../assets/icons/info.svg';
/**
* Component to display a notice when the confidence level is low
*/
-const LowConfidenceNotice: React.FC = () => {
+const LowConfidenceNotice: FC = () => {
const { t } = useTranslation();
return (
diff --git a/frontend/src/pages/ReportDetail/components/NormalValuesSection.tsx b/frontend/src/pages/ReportDetail/components/NormalValuesSection.tsx
index 37c5d375..0aca58a0 100644
--- a/frontend/src/pages/ReportDetail/components/NormalValuesSection.tsx
+++ b/frontend/src/pages/ReportDetail/components/NormalValuesSection.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import { FC } from 'react';
import { useTranslation } from 'react-i18next';
import Icon from '../../../common/components/Icon/Icon';
import { LabValue } from '../../../common/models/medicalReport';
@@ -12,7 +12,7 @@ interface NormalValuesSectionProps {
onToggle: () => void;
}
-const NormalValuesSection: React.FC = ({
+const NormalValuesSection: FC = ({
normalValues,
isExpanded,
onToggle,
diff --git a/frontend/src/pages/ReportDetail/components/OriginalReportTab.tsx b/frontend/src/pages/ReportDetail/components/OriginalReportTab.tsx
index d2888734..ecf8ad43 100644
--- a/frontend/src/pages/ReportDetail/components/OriginalReportTab.tsx
+++ b/frontend/src/pages/ReportDetail/components/OriginalReportTab.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import { FC } from 'react';
import { format } from 'date-fns';
import fileLinesIcon from '../../../assets/icons/file-lines.svg';
import { MedicalReport } from '../../../common/models/medicalReport';
@@ -9,7 +9,7 @@ interface OriginalReportTabProps {
reportData: MedicalReport;
}
-const OriginalReportTab: React.FC = ({ reportData }) => {
+const OriginalReportTab: FC = ({ reportData }) => {
// Function to format file size in KB or MB
const formatFileSize = (bytes: number): string => {
if (bytes < 1024) return bytes + ' B';
diff --git a/frontend/src/pages/ReportDetail/components/ReportHeader.tsx b/frontend/src/pages/ReportDetail/components/ReportHeader.tsx
index 79bee5d0..d9344fcb 100644
--- a/frontend/src/pages/ReportDetail/components/ReportHeader.tsx
+++ b/frontend/src/pages/ReportDetail/components/ReportHeader.tsx
@@ -1,31 +1,60 @@
-import React from 'react';
+import { FC } from 'react';
import { useTranslation } from 'react-i18next';
import closeIcon from '../../../assets/icons/close.svg';
+import backIcon from '../../../assets/icons/back.svg';
import bookmarkIcon from '../../../assets/icons/bookmark.svg';
import bookmarkFilledIcon from '../../../assets/icons/bookmark-filled.svg';
import { MedicalReport } from '../../../common/models/medicalReport';
+import { useHistory, useLocation } from 'react-router';
interface ReportHeaderProps {
reportData: MedicalReport;
- onClose: () => void;
}
-const ReportHeader: React.FC = ({ reportData, onClose }) => {
+const ReportHeader: FC = ({ reportData }) => {
const { t } = useTranslation();
+ const location = useLocation<{ from?: string }>();
+ const history = useHistory();
+
+ // Handle back button
+ const handleBack = () => {
+ history.goBack();
+ };
+
+ // Handle close button
+ const handleClose = () => {
+ history.push('/tabs/home');
+ };
return (
-
-
Results Analysis
-
-
+ {/* Header component - only show if previous path was /tabs/processing */}
+ {location.state?.from === '/tabs/processing' && (
+ <>
+
+
Results Analysis
+
+
-
+
+ >
+ )}
{/* Category & Title */}
+ {/* Back button */}
+ {location.state?.from !== '/tabs/processing' && (
+ <>
+
+ >
+ )}
+
{reportData.category && t(`list.${reportData.category}Category`, { ns: 'reportDetail' })}
{reportData.title}
diff --git a/frontend/src/pages/ReportDetail/components/ReportTabs.tsx b/frontend/src/pages/ReportDetail/components/ReportTabs.tsx
index f1511b61..121cbf65 100644
--- a/frontend/src/pages/ReportDetail/components/ReportTabs.tsx
+++ b/frontend/src/pages/ReportDetail/components/ReportTabs.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import { FC } from 'react';
import aiInsightIcon from '../../../assets/icons/ai-insight.svg';
interface ReportTabsProps {
@@ -6,7 +6,7 @@ interface ReportTabsProps {
onTabChange: (tab: 'ai' | 'original') => void;
}
-const ReportTabs: React.FC = ({ activeTab, onTabChange }) => {
+const ReportTabs: FC = ({ activeTab, onTabChange }) => {
return (