import type { Metadata } from "next"; import Link from "next/link"; import { EventRow } from "@/components/event-row"; import { LiveFeed } from "@/components/live-feed"; import { Badge, Chip, Empty, Flag, PageHeader, Panel, Score, StateLabelText } from "@/components/ui"; import { api, type Cluster, type EventItem } from "@/lib/api"; import { fmtOffset, relTime, typeLabel, utcTime } from "@/lib/format"; export const dynamic = "force-dynamic"; export const metadata: Metadata = { title: "Breaking", description: "Breaking now, developing, recently confirmed and watching — ranked by signal, velocity, novelty and confirmation, not by recency." }; /** Breaking desk (spec §34). */ export default async function BreakingPage() { const [desk, live] = await Promise.all([api.breakingDesk(), api.breaking(40)]); const d = desk ?? { breaking_now: [], developing: [], recently_confirmed: [], watching: [], generated_at: "" }; return ( <> Breaking is not recent: it needs strong signal, velocity, novelty, source quality, confirmation and cross-source activity.} title="Breaking" />
{d.watching.length ? d.watching.slice(0, 12).map((e) => ) : Nothing to watch.}
); } function ClusterSection({ title, tone, items, empty }: { title: string; tone: "hot" | "high" | "ok"; items: Cluster[]; empty: string }) { const color = tone === "hot" ? "text-hot" : tone === "high" ? "text-high" : "text-ok"; return ( {title} {items.length}} dense> {items.length === 0 ? ( {empty} ) : (
    {items.map((c) => { const e = c.event as EventItem | null | undefined; return (
  • {e?.source && {e.source.name}} {e?.country && } {e?.event_type && {typeLabel(e.event_type)}} {e?.silent_change && } {utcTime(c.last_at)} · {relTime(c.last_at)}
    {c.title} {e?.summary &&

    {e.summary}

    }
    {c.event_count} signal{c.event_count === 1 ? "" : "s"} · {c.source_count ?? 1} source{(c.source_count ?? 1) === 1 ? "" : "s"} {(c.first_party_count ?? 0) > 0 && {c.first_party_count} first-party} {(c.external_count ?? 0) > 0 && {c.external_count} external} {c.velocity !== undefined && c.velocity >= 40 && velocity {Math.round(c.velocity)}} {c.lead_time_ms && c.lead_time_ms > 0 ? lead {fmtOffset(c.lead_time_ms).replace("+", "")} : null} {c.sources && c.sources.length > 1 && {c.sources.slice(0, 4).map((s) => s.name).join(" · ")}{c.sources.length > 4 ? ` +${c.sources.length - 4}` : ""}}
  • ); })}
)}
); }