/* Copyright 2026 Marimo. All rights reserved. */ import { AlertCircleIcon, CheckIcon, CircleIcon } from "lucide-react"; import type { ReactNode } from "react"; import { Spinner } from "@/components/icons/spinner"; import { cn } from "@/utils/cn"; export type ProgressState = "waiting" | "running" | "succeeded" | "failed"; export interface ProgressStage { id: string; state: ProgressState; title: string; description: string; details?: ReactNode; } export function ProgressStatusIcon({ state, variant = "icon", }: { state: ProgressState; variant?: "icon" | "dot"; }) { if (variant === "dot") { return ( ); } const Icon = { waiting: CircleIcon, running: Spinner, succeeded: CheckIcon, failed: AlertCircleIcon, }[state]; return ( ); } export function ProgressStages({ stages, label, className, }: { stages: readonly ProgressStage[]; label: string; className?: string; }) { return (
    {stages.map((stage, index) => (
  1. {index < stages.length - 1 && ( )}
    {stage.title}

    {stage.description}

    {stage.details}
  2. ))}
); }