Skip to content

Commit 25b0b96

Browse files
authored
Merge pull request #132 from ModusCreateOrg/ADE-208
[ADE-208] Add AiAssistantNotice component to provide AI assistance link in reports
2 parents 154e3ee + 862af79 commit 25b0b96

File tree

5 files changed

+73
-92
lines changed

5 files changed

+73
-92
lines changed

frontend/src/pages/Reports/components/AiAnalysisTab.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import EmergencyAlert from './EmergencyAlert';
44
import FlaggedValuesSection from './FlaggedValuesSection';
55
import NormalValuesSection from './NormalValuesSection';
66
import LowConfidenceNotice from './LowConfidenceNotice';
7+
import AiAssistantNotice from './AiAssistantNotice';
78

89
interface AiAnalysisTabProps {
910
reportData: MedicalReport;
@@ -59,6 +60,9 @@ const AiAnalysisTab: React.FC<AiAnalysisTabProps> = ({
5960
isExpanded={normalValuesExpanded}
6061
onToggle={toggleNormalValues}
6162
/>
63+
64+
{/* AI Assistant Notice */}
65+
<AiAssistantNotice />
6266
</div>
6367
);
6468
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.ai-assistant-notice {
2+
padding: 20px 0;
3+
display: flex;
4+
justify-content: center;
5+
6+
&__content {
7+
display: flex;
8+
flex-direction: column;
9+
align-items: center;
10+
text-align: center;
11+
}
12+
13+
.clarification-text {
14+
font-size: 15px;
15+
margin-bottom: 8px;
16+
}
17+
18+
.assistant-link {
19+
color: #6177FF;
20+
font-size: 15px;
21+
cursor: pointer;
22+
font-weight: 500;
23+
24+
&:hover {
25+
text-decoration: underline;
26+
}
27+
}
28+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React, { useState } from 'react';
2+
import { IonText } from '@ionic/react';
3+
import AIAssistantModal from '../../../common/components/AIAssistant/AIAssistantModal';
4+
import './AiAssistantNotice.scss';
5+
6+
/**
7+
* Component to display an AI Assistant notice with a link to open the AI Chat modal.
8+
*/
9+
const AiAssistantNotice: React.FC = () => {
10+
const [isAIAssistantOpen, setIsAIAssistantOpen] = useState(false);
11+
12+
const handleOpenAIAssistant = () => {
13+
setIsAIAssistantOpen(true);
14+
};
15+
16+
return (
17+
<div className="ai-assistant-notice">
18+
<div className="ai-assistant-notice__content">
19+
<IonText color="dark" className="clarification-text">
20+
Still need further clarifications?
21+
</IonText>
22+
23+
<div
24+
className="assistant-link"
25+
onClick={handleOpenAIAssistant}
26+
>
27+
Ask our AI Assistant &gt;
28+
</div>
29+
</div>
30+
31+
<AIAssistantModal
32+
isOpen={isAIAssistantOpen}
33+
setIsOpen={setIsAIAssistantOpen}
34+
testid="report-ai-assistant-modal"
35+
/>
36+
</div>
37+
);
38+
};
39+
40+
export default AiAssistantNotice;

frontend/src/pages/Reports/components/OriginalReport.tsx

Lines changed: 0 additions & 91 deletions
This file was deleted.

frontend/src/pages/Upload/__tests__/UploadPage.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ vi.mock('common/components/Upload/UploadModal', () => {
5555
bookmarked: false,
5656
processingStatus: ProcessingStatus.PROCESSED,
5757
labValues: [],
58-
summary: 'Test report summary',
58+
medicalComments: 'Test report medical comments',
5959
filePath: '/reports/test-report.pdf',
6060
originalFilename: 'test-report.pdf',
6161
fileSize: 1024,

0 commit comments

Comments
 (0)