import { Clock } from "lucide-react"; import { BillAction } from "@/lib/types"; import { formatDate } from "@/lib/utils"; interface ActionTimelineProps { actions: BillAction[]; latestActionDate?: string; latestActionText?: string; } export function ActionTimeline({ actions, latestActionDate, latestActionText }: ActionTimelineProps) { const hasActions = actions && actions.length > 0; const hasFallback = !hasActions && latestActionText; if (!hasActions && !hasFallback) { return (

Action History

No actions recorded yet.

); } return (

Action History {hasActions && ( ({actions.length}) )}

    {hasActions ? ( actions.map((action) => (
  • {formatDate(action.action_date)} {action.chamber && ` · ${action.chamber}`}

    {action.action_text}

  • )) ) : (
  • {formatDate(latestActionDate)} · latest known action

    {latestActionText}

    Full history loads in the background — refresh to see all actions.

  • )}
); }