import { cn } from "@/lib/utils"; import type { TxStatus } from "@/lib/explorer-types"; const STEPS = [ { key: "submit" as const, title: "Submit", body: "Transaction enters the private permissioned layer.", }, { key: "confirm" as const, title: "Confirm", body: "Validators finalize it on the private layer.", }, { key: "anchor" as const, title: "Anchor", body: "A public-chain commitment proves the private state.", }, ]; function stepState( status: TxStatus, key: "submit" | "confirm" | "anchor", ): "done" | "active" | "todo" { if (status === "pending") { if (key === "submit") return "active"; return "todo"; } if (status === "confirmed") { if (key === "submit") return "done"; if (key === "confirm") return "active"; return "todo"; } // anchored return "done"; } export function HybridTimeline({ status }: { status: TxStatus }) { return (
    {STEPS.map((step, i) => { const state = stepState(status, step.key); return (
  1. {i + 1} {step.title}

    {step.body}

    {state === "done" && "complete"} {state === "active" && "current"} {state === "todo" && "waiting"}

  2. ); })}
); }