import { citationAnchor } from "../../lib/citations/inline"; import type { CitationView } from "../../lib/report/views"; import { cn } from "../../lib/utils"; import { CitationCard } from "./CitationCard"; // A NUMBERED REFERENCE LIST — a report's citations (or one section's), in // number order, each entry a CitationCard (`reference`) under the number the // inline markers show. The report-wide list carries the anchors `c-` the // markers jump to; a per-section list passes `anchors={false}` so an id is on // the page once. // // Pure: the citations come in as props, already numbered (lib/report/views.ts // orderedCitations / sectionCitations). export function ReferenceList({ citations, anchors = true, className, addedLabel, }: { citations: readonly CitationView[]; anchors?: boolean; className?: string; // The words behind an added citation's mark (CitationCard). addedLabel?: string; }) { if (citations.length === 0) return null; return (
    {citations.map((c) => (
  1. {c.number !== undefined ? `${c.number}.` : "·"}
  2. ))}
); }