import React from 'react'; import { AtomicHotspot, ToxicityPredictionResult } from '../types'; import { Layers, Sparkles, AlertCircle, ShieldAlert, Eye } from 'lucide-react'; interface AtomicHotspotViewerProps { prediction: ToxicityPredictionResult; } export const AtomicHotspotViewer: React.FC = ({ prediction }) => { return (
{/* Header */}

Explainable AI (XAI): Atomic Toxicity Hotspot Mapping

Graph Attention Weights α_ij highlight toxicophore functional groups contributing to organ risks.

Query: {prediction.compoundName}
{/* SMILES Interactive Chemical Hotspot Bar */}
Atomic Attention Heatmap (Graph Transformer Layer) Higher Attention = Higher Toxicity Weight
{/* Atom Badges */}
{prediction.atomicHotspots.map((atom) => { let bgClass = 'bg-slate-800 text-slate-300 border-slate-700'; if (atom.attentionWeight >= 0.6) bgClass = 'bg-rose-950 text-rose-200 border-rose-700 font-bold animate-pulse'; else if (atom.attentionWeight >= 0.4) bgClass = 'bg-amber-950 text-amber-200 border-amber-700'; else if (atom.attentionWeight >= 0.25) bgClass = 'bg-indigo-950 text-indigo-200 border-indigo-700'; return (
{atom.symbol} #{atom.atomIndex} ({atom.attentionWeight})
); })}
{/* Identified Toxicophore Functional Groups */}

Structural Toxicophores Detected

{prediction.toxicophores.map((tox, idx) => (
{tox}

Key contributor to phase I reactive metabolite generation or off-target ion channel block.

))}
); };