malavikapradeep2001 commited on
Commit
095c768
·
1 Parent(s): b56d2fb
frontend/src/components/ReportModal.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { useState } from 'react';
2
  import { XIcon } from 'lucide-react';
3
  // Static defaults for fields requested to be static. Change these constants to update the values shown.
4
  const DEFAULT_PATIENT_ID = '41334';
@@ -40,6 +40,11 @@ export function ReportModal({ isOpen, onClose, onSubmit, analysisId, analysisSum
40
  analysis_id: analysisId,
41
  });
42
 
 
 
 
 
 
43
  if (!isOpen) return null;
44
 
45
  const handleSubmit = (e: React.FormEvent) => {
 
1
+ import { useState, useEffect } from 'react';
2
  import { XIcon } from 'lucide-react';
3
  // Static defaults for fields requested to be static. Change these constants to update the values shown.
4
  const DEFAULT_PATIENT_ID = '41334';
 
40
  analysis_id: analysisId,
41
  });
42
 
43
+ // Keep internal form state in sync when the parent passes a new analysisId
44
+ useEffect(() => {
45
+ setFormData(prev => ({ ...prev, analysis_id: analysisId }));
46
+ }, [analysisId]);
47
+
48
  if (!isOpen) return null;
49
 
50
  const handleSubmit = (e: React.FormEvent) => {
frontend/src/components/ResultsPanel.tsx CHANGED
@@ -297,7 +297,8 @@ export function ResultsPanel({ uploadedImage, result, loading }: ResultsPanelPro
297
  onClose={() => setShowReportModal(false)}
298
  onSubmit={handleGenerateReport}
299
  analysisId={annotated_image_url || ""}
300
- analysisSummaryJson={summary ? JSON.stringify({ ...summary, model_used, confidence }) : "{}"}
 
301
  />
302
  </div>
303
  );
 
297
  onClose={() => setShowReportModal(false)}
298
  onSubmit={handleGenerateReport}
299
  analysisId={annotated_image_url || ""}
300
+ // Include annotated_image_url in the analysis summary so the backend can embed it
301
+ analysisSummaryJson={summary ? JSON.stringify({ ...summary, model_used, confidence, annotated_image_url }) : "{}"}
302
  />
303
  </div>
304
  );