cruise 0.1.28

YAML-driven coding agent workflow orchestrator
Documentation
import type { SessionPhase } from "../types";

const PHASE_COLORS: Record<SessionPhase, string> = {
  "Awaiting Approval": "bg-yellow-900/50 text-yellow-300",
  Planned: "bg-blue-900/50 text-blue-300",
  Running: "bg-green-900/50 text-green-300",
  Completed: "bg-gray-700/50 text-gray-300",
  Failed: "bg-red-900/50 text-red-300",
  Suspended: "bg-orange-900/50 text-orange-300",
};

export function PhaseBadge({
  phase,
  planAvailable,
}: {
  phase: SessionPhase;
  planAvailable?: boolean;
}) {
  const cls = PHASE_COLORS[phase];
  const showApproveReady = phase === "Awaiting Approval" && planAvailable === true;
  return (
    <span className={`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium ${cls}`}>
      {showApproveReady && (
        <span
          role="img"
          aria-label="plan ready for approval"
          className="w-2 h-2 rounded-full bg-blue-400 flex-shrink-0"
        />
      )}
      {phase}
    </span>
  );
}