import Link from "next/link"; import { RelativeTime } from "@/components/ui/freshness"; import { StatusBadge } from "@/components/ui/status-badge"; import { cx, EVENT_TYPE_LABEL, instrumentHref } from "@/lib/format"; import type { MarketEvent } from "@/lib/types"; const TYPE_TONE: Record = { TRADING_HALT: "text-negative", SCHEMA_DRIFT: "text-negative", SOURCE_FAILURE: "text-warning", SOURCE_DIVERGENCE: "text-warning", VOLATILITY_SPIKE: "text-warning", MARKET_OPEN: "text-positive", TRADING_RESUME: "text-positive", SOURCE_RECOVERY: "text-positive", FILING_PUBLISHED: "text-accent", DOCUMENT_CHANGED: "text-accent", }; export function EventRow({ e, dense, className }: { e: MarketEvent; dense?: boolean; className?: string }) { const first = e.instruments?.[0]; const url = typeof e.data?.url === "string" ? (e.data.url as string) : null; return (
  • {EVENT_TYPE_LABEL[e.type] ?? e.type.replace(/_/g, " ").toLowerCase()} {(e.severity === "WARNING" || e.severity === "CRITICAL") && } {first?.symbol && ( {first.symbol} )}
    {e.title} {!dense && e.summary &&
    {e.summary}
    }
    {e.source_count} source{e.source_count === 1 ? "" : "s"} {e.sources?.length ? ` · ${e.sources.slice(0, 3).join(", ")}` : ""} confidence {Math.round(e.confidence * 100)}% {url && ( document ↗ )}
  • ); }