import { CheckCircle2, Loader2, X, XCircle } from "lucide-react"; import type { StackActionStatus } from "@/hooks/useStackActions"; const TONE = { running: "border-sp-border bg-sp-surface-2 text-sp-text-1", success: "border-sp-green/30 bg-sp-green/10 text-sp-green", error: "border-red-300 bg-red-50 text-red-700 dark:border-red-900/60 dark:bg-red-950/40 dark:text-red-300", } as const; /** Persistent status line for one stack action (start/stop/pull/update/…), * shown in addition to the transient toast so the outcome doesn't vanish * with it — and so a failure stays readable until acknowledged. */ export function ActionStatusBanner({ status, onDismiss, }: { status: StackActionStatus; onDismiss: (id: string) => void; }) { return (
{status.phase === "running" && ( )} {status.phase === "success" && } {status.phase === "error" && } {status.phase === "running" && `${status.label} ${status.id}…`} {status.phase === "success" && `${status.label} ${status.id} — done`} {status.phase === "error" && `${status.label} ${status.id} — failed${status.message ? `: ${status.message}` : ""}`} {status.phase !== "running" && ( )}
); } /** Stacked banners, one per stack currently being acted on. Renders nothing * when idle. */ export function ActionStatusList({ statuses, onDismiss, }: { statuses: StackActionStatus[]; onDismiss: (id: string) => void; }) { if (statuses.length === 0) return null; return (
{statuses.map((s) => ( ))}
); }