import { BookOpenCheck, ExternalLink, Loader2, AlertTriangle, ChevronDown, ClipboardList } from 'lucide-react'; import { summariseEvidence, EVIDENCE_TITLE, EVIDENCE_LOADING, ACTION_PLAN_ANCHOR_ID, } from '../utils/evidenceSummary'; /** * Card B — Evidence-backed actions (v3 §1). * * What trials (or, labelled as such, cohorts) measured for an action, on a * future outcome, in their own population. It is deliberately a separate card * from Estimate drivers — its own border, accent and icon, never nested in the * SHAP card — because the two answer different questions and must not be read * together as "treat X and this patient's number falls". * * Every number shown comes from the /evidence-actions response (copied from * backend/evidence/registry.yaml); wording and classification come from * evidenceSummary.js, which the PDF uses too. * * Rendering states: loading → spinner; error → "Evidence could not be loaded" * with no numbers; empty → says nothing maps; ready → items. */ function Header() { return (
{text}
); } function scrollToActionPlan(event) { event.preventDefault(); document.getElementById(ACTION_PLAN_ANCHOR_ID)?.scrollIntoView({ behavior: 'smooth', block: 'center' }); } function EvidenceBadge({ effect }) { if (!effect.label) return null; const cls = effect.observational ? 'bg-amber-100 text-amber-800 border-amber-300' : 'bg-teal-100 text-teal-800 border-teal-200'; return ( {effect.label} ); } function SourceChip({ effect }) { if (!effect.url) return null; return ( {effect.citation} ); } function RuleSource({ source }) { if (!source) return null; return ({item.action}
{item.headline &&{item.headline}
} {item.reasons.length > 1 && ({item.ruleLine}
}{line}
))} {item.outcomeLine &&{item.outcomeLine}
} {item.mappedLine && ({item.mappedLine}{item.matchLine && ` · ${item.matchLine}`}
)}{effect.text}
{effect.showSource && ({c}
))} {item.measurementLine &&{item.measurementLine}
} {item.notes.map((n) =>{n}
)}{ev.message}
} {ev.sections.map((section) => ( section.collapsed ? (