ADjayantan commited on
Commit
11bf2dd
·
1 Parent(s): b5418a1

EpiADR-Net UI: Added Clinical Research Scope Banner, Export Clinical CSV Report, and UI reliability enhancements

Browse files
frontend/src/components/PredictionPanel.tsx CHANGED
@@ -53,6 +53,55 @@ export const PredictionPanel: React.FC<PredictionPanelProps> = ({
53
  return (
54
  <div className="space-y-6">
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  {/* Molecule Input & Preset Selector */}
57
  <div className="bg-slate-900 border border-slate-800 rounded-2xl p-5 shadow-lg space-y-4">
58
  <div className="flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 pb-3">
 
53
  return (
54
  <div className="space-y-6">
55
 
56
+ {/* Medical Doctor & Biological Research Scope Banner */}
57
+ <div className="bg-gradient-to-r from-rose-950/80 via-slate-900 to-slate-950 border border-rose-900/60 rounded-2xl p-4 shadow-lg flex flex-wrap items-center justify-between gap-3">
58
+ <div className="flex items-center space-x-3">
59
+ <div className="p-2 bg-rose-900/40 rounded-xl text-rose-300 border border-rose-700/50">
60
+ <ShieldAlert className="w-5 h-5 animate-pulse" />
61
+ </div>
62
+ <div>
63
+ <div className="flex items-center space-x-2">
64
+ <span className="text-xs font-bold text-rose-200 uppercase tracking-wider">Clinical & Biological Research Scope</span>
65
+ <span className="bg-rose-900/60 text-rose-300 text-[10px] font-extrabold px-2 py-0.5 rounded-full border border-rose-700/60">
66
+ MD / Toxicologist Access Only
67
+ </span>
68
+ </div>
69
+ <p className="text-xs text-slate-300 mt-0.5">
70
+ Computational in-silico disaggregation intended for certified Medical Doctors, Clinical Pharmacologists, and Preclinical Researchers.
71
+ </p>
72
+ </div>
73
+ </div>
74
+
75
+ <button
76
+ onClick={() => {
77
+ const csvData = [
78
+ ['Compound Name', prediction.compoundName],
79
+ ['SMILES', activeSmiles],
80
+ ['Applicability Domain', prediction.applicabilityDomain],
81
+ ['Tanimoto Score', prediction.tanimotoSimilarity],
82
+ ['Hepatotoxicity (Liver)', `${(prediction.organScores.liver.meanRisk * 100).toFixed(1)}% (±${prediction.organScores.liver.uncertaintySigma})`],
83
+ ['Cardiotoxicity (Heart)', `${(prediction.organScores.heart.meanRisk * 100).toFixed(1)}% (±${prediction.organScores.heart.uncertaintySigma})`],
84
+ ['Nephrotoxicity (Kidney)', `${(prediction.organScores.kidney.meanRisk * 100).toFixed(1)}% (±${prediction.organScores.kidney.uncertaintySigma})`],
85
+ ['Neurotoxicity (Brain)', `${(prediction.organScores.brain.meanRisk * 100).toFixed(1)}% (±${prediction.organScores.brain.uncertaintySigma})`],
86
+ ['Pulmotoxicity (Lung)', `${(prediction.organScores.lung.meanRisk * 100).toFixed(1)}% (±${prediction.organScores.lung.uncertaintySigma})`]
87
+ ].map(e => e.join(',')).join('\n');
88
+
89
+ const blob = new Blob([csvData], { type: 'text/csv;charset=utf-8;' });
90
+ const url = URL.createObjectURL(blob);
91
+ const link = document.createElement('a');
92
+ link.setAttribute('href', url);
93
+ link.setAttribute('download', `EpiADR_Report_${prediction.compoundName.replace(/[^a-zA-Z0-9]/g, '_')}.csv`);
94
+ document.body.appendChild(link);
95
+ link.click();
96
+ document.body.removeChild(link);
97
+ }}
98
+ className="px-3.5 py-1.5 bg-slate-950 hover:bg-slate-800 text-rose-300 border border-rose-800/80 rounded-xl text-xs font-bold transition-all flex items-center space-x-1.5 shadow"
99
+ >
100
+ <Database className="w-3.5 h-3.5 text-rose-400" />
101
+ <span>Export Clinical CSV Report</span>
102
+ </button>
103
+ </div>
104
+
105
  {/* Molecule Input & Preset Selector */}
106
  <div className="bg-slate-900 border border-slate-800 rounded-2xl p-5 shadow-lg space-y-4">
107
  <div className="flex flex-wrap items-center justify-between gap-2 border-b border-slate-800 pb-3">