import { useEffect, type ReactNode } from "react"; import { AnimatePresence, motion } from "framer-motion"; import { Trash, XCircle } from "./icons"; import { ActionButton } from "./primitives"; import { useFocusTrap } from "./hooks"; const EASE = [0.16, 1, 0.3, 1] as const; /* ------------------------------------------------------------------ */ /* StatusPill */ /* ------------------------------------------------------------------ */ export function StatusPill({ status }: { status: string }) { const positive = ["ready", "active", "running", "succeeded", "approved", "achieved", "done"].includes(status); const negative = ["error", "failed", "cancelled", "blocked", "rejected", "interrupted"].includes(status); const warning = ["auth_required", "degraded", "pending", "in_review", "todo", "queued", "not_installed"].includes(status); const checking = status === "detected"; const toneClass = positive ? "text-success" : negative ? "text-destructive" : warning ? "text-warning" : "text-muted-foreground"; const dotClass = positive ? "bg-success" : negative ? "bg-destructive" : warning ? "bg-warning" : "bg-[color:var(--muted-foreground)]"; const displayLabel = checking ? "checking" : status.replaceAll("_", " "); return ( {checking ? (