'use client'; import Link from 'next/link'; import { ConfidenceBadge, CountryChip, EventTypeBadge, ImportanceMeter } from '@/components/ui/badges'; import { LiveAgo } from '@/components/ui/live'; import { cn } from '@/lib/cn'; import { eventStyle } from '@/lib/event-styles'; import { fmtTime, truncate } from '@/lib/format'; import { routes } from '@/lib/site'; import type { Event } from '@/lib/types'; import { useEventDrawer } from './event-drawer-context'; /** * Dense feed row: hue bar · type chip · title (opens the evidence drawer) · company · importance · confidence · time. * `variant="feed"` is the live feed (fresh rows animate); `"table"` is the events list; `"timeline"` hides the company. */ export function EventRow({ event, fresh = false, selected = false, variant = 'feed', showCompany = true, className, id }: { event: Event; fresh?: boolean; selected?: boolean; variant?: 'feed' | 'table' | 'timeline'; showCompany?: boolean; className?: string; id?: string }) { const { open } = useEventDrawer(); const s = eventStyle(event.event_type); const retracted = event.status === 'retracted'; return (
  • {showCompany && ( {event.company.display_name} )} {showCompany && } {variant === 'timeline' ? {fmtTime(event.detected_at)} UTC : }
    {event.summary && variant !== 'feed' &&

    {truncate(event.summary, 200)}

    }
    {event.old_value && event.new_value && ( {truncate(event.old_value, 28)} → {truncate(event.new_value, 28)} )} {event.origin !== 'deterministic' && {event.origin}} {retracted && retracted} Details →
  • ); } export function EventList({ events, className, variant = 'table', showCompany = true, emptyLabel = 'No monitored evidence available yet.' }: { events: Event[]; className?: string; variant?: 'feed' | 'table' | 'timeline'; showCompany?: boolean; emptyLabel?: string }) { if (!events.length) return

    {emptyLabel}

    ; return ( ); }