import type { ReactNode } from "react"; import type { ExtractionRecordEntry } from "../types"; import { latestExtractionsByOutcome } from "../utils/confidence"; const KLIMISCH_LABELS: Record = { 1: "1 – reliable without restriction", 2: "2 – reliable with restrictions", 3: "3 – not reliable", 4: "4 – not assignable", }; export function ExtractionList({ records, onAddAnother, extra }: { records: ExtractionRecordEntry[]; onAddAnother: () => void; extra?: ReactNode; }) { return (
{latestExtractionsByOutcome(records).map((r) => (
Extracted by {r.extracted_by} {r.outcome ? ` — ${r.outcome}` : ""} {r.evidence_stream ? ` (${r.evidence_stream.replace("_", " ")})` : ""}:{" "} {[r.species, r.route, r.duration, r.effect_finding].filter(Boolean).join(" · ")} {r.klimisch_score != null && (
Klimisch: {KLIMISCH_LABELS[r.klimisch_score] ?? r.klimisch_score} {r.klimisch_justification ? ` — ${r.klimisch_justification}` : ""}
)}
))} {" "} {extra}
); }