"use client" /** * A vertical deploy/build timeline — one dot-and-rail row per event, colored by * its normalized status, newest first. Honest empty state when there are no * events. Pure presentation over `DeployEvent[]`. */ import { Text, XStack, YStack } from "@hanzo/gui" import { normalizeServiceStatus, statusColors, statusLabel } from "./status" import { relativeTime } from "./time" import type { DeployEvent, ServiceStatus, StatusPalette } from "./types" export interface DeployTimelineProps { events: DeployEvent[] statusPalette?: Partial> now?: number emptyLabel?: string } export function DeployTimeline({ events, statusPalette, now, emptyLabel = "No deployments yet.", }: DeployTimelineProps) { if (!events.length) { return ( {emptyLabel} ) } return ( {events.map((e, i) => { const st = normalizeServiceStatus(String(e.status)) const c = statusColors(st, statusPalette) const last = i === events.length - 1 return ( {/* Rail */} {!last ? ( ) : null} {e.ref ?? statusLabel(st)} {statusLabel(st)} {e.createdAt ? ( {relativeTime(e.createdAt, now)} ) : null} {e.source || e.message ? ( {[e.source, e.message].filter(Boolean).join(" · ")} ) : null} ) })} ) }