import { ExternalLink } from 'lucide-react'; import Link from 'next/link'; import { ConfidenceBadge, OriginBadge, StatusBadge } from '@/components/ui/badges'; import { KV, Row } from '@/components/ui/key-value'; import { fmtDateTime, pathOf } from '@/lib/format'; import { routes, SURFACE_LABELS } from '@/lib/site'; import type { Event, EventSource } from '@/lib/types'; /** * Evidence block shared by the drawer and `/events/[id]`: the careful-language contract (spec §165–171). * Every source is listed with its detection time; old/new values are shown verbatim; LLM origin shows model + prompt. */ export function EventEvidence({ event, sources, compact = false }: { event: Event; sources: EventSource[] | undefined; compact?: boolean }) { const list = sources && sources.length ? sources : event.source_url ? [{ source_url: event.source_url, surface: event.surface, detected_at: event.detected_at, kind: 'primary', sensor_id: event.sensor_id }] : []; const llm = event.origin === 'llm' || event.origin === 'hybrid'; return (
{event.status === 'retracted' ? 'This event was retracted after review. It is kept for auditability and is not counted in metrics.' : event.status === 'duplicate' ? 'This event was merged into another canonical event.' : 'This event is awaiting human review.'}
)} {(event.old_value || event.new_value) && (Before
{event.old_value ?? not previously observed}
After
{event.new_value ?? no longer observed}
Sources ({list.length})
{list.length === 0 ? (The monitored source for this event is not available any more; the observation is kept.
) : (event {event.id} {event.cluster_id ? ` · cluster ${event.cluster_id}` : ''} {event.change_id ? ` · change ${event.change_id}` : ''} {event.sensor_id ? ` · sensor ${event.sensor_id}` : ''}