Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions frontend/src/assets/icons/no-values.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions frontend/src/assets/icons/orange-alert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions frontend/src/assets/icons/red-alert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions frontend/src/common/utils/i18n/resources/en/reportDetail.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
"title": "Flagged values"
},
"normal-values": {
"title": "Normal values"
"title": "Normal values",
"empty": "No values available.",
"empty-description": "No normal values within the normal range were detected."
},
"conclusion": {
"title": "Conclusion"
Expand All @@ -88,4 +90,4 @@
"original-report": "Original Report"
}
}
}
}
49 changes: 49 additions & 0 deletions frontend/src/pages/Reports/ReportDetailPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,52 @@
align-items: center;
}

&__section-empty {
padding: 24px 16px 32px;
background-color: #fff;
}

&__section-empty-content {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}

&__section-empty-icon {
background-color: #EEF1FF;
border-radius: 50%;
width: 90px;
height: 90px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 32px;

img {
width: 48px;
height: 48px;
}
}

&__section-empty-title {
font-family: 'Inter', sans-serif;
font-size: 18px;
font-weight: 600;
color: #313e4c;
margin: 0 0 16px;
}

&__section-empty-description {
font-family: 'Inter', sans-serif;
font-size: 14px;
font-weight: 400;
color: #313e4c;
margin: 0;
max-width: 286px;
line-height: 22px;
}

&__item {
background-color: #ffffff;
border-radius: 8px;
Expand Down Expand Up @@ -538,6 +584,9 @@
}

&--value {
display: flex;
justify-content: end;
align-items: center;
width: 100px;
text-align: right;
font-family: 'Inter', sans-serif;
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/pages/Reports/ReportDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ const ReportDetailPage: React.FC = () => {
return (
<IonPage>
<IonContent className="ion-padding">
<div>
{t('error.loading.report', { ns: 'errors', errorMessage: (error as Error).message })}
</div>
<div>{t('loading.report', { ns: 'errors', errorMessage: (error as Error).message })}</div>
</IonContent>
</IonPage>
);
Expand All @@ -67,7 +65,7 @@ const ReportDetailPage: React.FC = () => {
return (
<IonPage>
<IonContent className="ion-padding">
<div>{t('error.no-report-data', { ns: 'errors' })}</div>
<div>{t('no-report-data', { ns: 'errors' })}</div>
</IonContent>
</IonPage>
);
Expand Down
19 changes: 18 additions & 1 deletion frontend/src/pages/Reports/components/NormalValuesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Icon from '../../../common/components/Icon/Icon';
import { LabValue } from '../../../common/models/medicalReport';
import LabValueItem from './LabValueItem';
import normalValuesIcon from '../../../assets/icons/normal-values.svg';
import noValuesIcon from '../../../assets/icons/no-values.svg';

interface NormalValuesSectionProps {
normalValues: LabValue[];
Expand Down Expand Up @@ -35,7 +36,23 @@ const NormalValuesSection: React.FC<NormalValuesSectionProps> = ({
</div>
</div>

{isExpanded && normalValues.map((item, index) => <LabValueItem key={index} item={item} />)}
{isExpanded && normalValues.length === 0 && (
<div className="report-detail-page__section-empty">
<div className="report-detail-page__section-empty-content">
<img src={noValuesIcon} alt="No Values Icon" style={{ marginBottom: '2rem' }} />
<h3 className="report-detail-page__section-empty-title">
{t('report.normal-values.empty', { ns: 'reportDetail' })}
</h3>
<p className="report-detail-page__section-empty-description">
{t('report.normal-values.empty-description', { ns: 'reportDetail' })}
</p>
</div>
</div>
)}

{isExpanded &&
normalValues.length > 0 &&
normalValues.map((item, index) => <LabValueItem key={index} item={item} />)}
</div>
);
};
Expand Down
24 changes: 15 additions & 9 deletions frontend/src/pages/Reports/components/OriginalReportTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from 'react';
import { format } from 'date-fns';
import Icon from '../../../common/components/Icon/Icon';
import { MedicalReport } from '../../../common/models/medicalReport';
import orangeAlertIcon from '../../../assets/icons/orange-alert.svg';
import redAlertIcon from '../../../assets/icons/red-alert.svg';

interface OriginalReportTabProps {
reportData: MedicalReport;
Expand Down Expand Up @@ -40,20 +42,24 @@ const OriginalReportTab: React.FC<OriginalReportTabProps> = ({ reportData }) =>

{/* Test Results Rows */}
{reportData.labValues.map((labValue, index) => (
<div
key={index}
className={`report-detail-page__results-row ${
labValue.status !== 'normal' ? 'report-detail-page__results-row--flagged' : ''
}`}
>
<div key={index} className="report-detail-page__results-row">
<div className="report-detail-page__results-cell report-detail-page__results-cell--test">
{labValue.name}
<p>{labValue.name}</p>
</div>
<div className="report-detail-page__results-cell report-detail-page__results-cell--value">
{labValue.value} {labValue.unit}
{labValue.status !== 'normal' && (
<img
src={labValue.status === 'low' ? orangeAlertIcon : redAlertIcon}
style={{ display: 'block', marginRight: '1rem' }}
/>
)}

<p>
{labValue.value} {labValue.unit}
</p>
</div>
<div className="report-detail-page__results-cell report-detail-page__results-cell--ref">
{labValue.normalRange}
<p>{labValue.normalRange}</p>
</div>
</div>
))}
Expand Down