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 !== 'active' && (

{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}

)} div]:grid-cols-[6.5rem_minmax(0,1fr)]' : undefined}> {Math.round(event.importance > 1 ? event.importance : event.importance * 100)} / 100 {fmtDateTime(event.detected_at)} {event.effective_at && ( {fmtDateTime(event.effective_at)} )} {event.published_at && ( {fmtDateTime(event.published_at)} )} {event.surface && {SURFACE_LABELS[event.surface] ?? event.surface}} {llm && ( {event.model_name ?? 'model'} {event.prompt_version ? ` · prompt ${event.prompt_version}` : ''} — LLM-enriched interpretation of a deterministic change )} {event.status !== 'active' && ( )} {event.tags.length > 0 && ( {[...new Set(event.tags)].map((t) => ( {t} ))} )}

Sources ({list.length})

{list.length === 0 ? (

The monitored source for this event is not available any more; the observation is kept.

) : ( )}
{event.change_id && ( View block-level change diff → )} {event.sensor_id && ( Sensor )} Company timeline

event {event.id} {event.cluster_id ? ` · cluster ${event.cluster_id}` : ''} {event.change_id ? ` · change ${event.change_id}` : ''} {event.sensor_id ? ` · sensor ${event.sensor_id}` : ''}

); }