Spaces:
Sleeping
Sleeping
Download web/src/components/chat/EvidenceList.tsx from TBM99/CoverageCheck: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/TBM99/CoverageCheck/resolve/main/web/src/components/chat/EvidenceList.tsx
- Command line
-
hf download hf://spaces/TBM99/CoverageCheck/web/src/components/chat/EvidenceList.tsx
-
curl -L -o EvidenceList.tsx https://huggingface.co/spaces/TBM99/CoverageCheck/resolve/main/web/src/components/chat/EvidenceList.tsx
1.23 kB
| import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion' | |
| import type { Passage } from '@/lib/types' | |
| /** The passages the answer model read, exactly as it read them (label = title + in-force | |
| * dates), in prompt order. For C they arrive before the answer call. */ | |
| export function EvidenceList({ passages }: { passages: Passage[] }) { | |
| return ( | |
| <Accordion type="multiple" className="w-full"> | |
| {passages.map((p, i) => ( | |
| <AccordionItem key={p.chunk_id} value={p.chunk_id}> | |
| <AccordionTrigger className="py-2 text-left text-sm break-words"> | |
| <span> | |
| <span className="mr-2 text-muted-foreground tabular-nums">{i + 1}.</span> | |
| <span className="font-medium">{p.source_id}</span> | |
| <span className="ml-2 text-xs text-muted-foreground"> | |
| {p.label} | |
| {p.pages ? ` · ${p.pages}` : ''} | |
| </span> | |
| </span> | |
| </AccordionTrigger> | |
| <AccordionContent> | |
| <p className="rounded-md bg-muted/50 p-3 text-xs leading-relaxed whitespace-pre-wrap">{p.text}</p> | |
| </AccordionContent> | |
| </AccordionItem> | |
| ))} | |
| </Accordion> | |
| ) | |
| } | |