// Circuit breaker state configuration

export type CircuitState = "closed" | "open" | "half_open";

export const stateLabels: Record<CircuitState, string> = {
  closed: "Closed",
  open: "Open",
  half_open: "Half-Open",
};

export const stateColors: Record<CircuitState, string> = {
  closed: "bg-emerald-500/20 text-emerald-700 dark:text-emerald-300",
  open: "bg-red-500/20 text-red-700 dark:text-red-300",
  half_open: "bg-amber-500/20 text-amber-700 dark:text-amber-300",
};

export const stateIcons: Record<CircuitState, string> = {
  closed: "\u25CF", // ●
  open: "\u25CB",   // ○
  half_open: "\u25D0", // ◐
};

export const stateDescriptions: Record<CircuitState, string> = {
  closed: "Operating normally, requests are being processed",
  open: "Circuit tripped, requests are being rejected",
  half_open: "Testing recovery, allowing limited requests",
};

// Health summary thresholds
export const HEALTHY_THRESHOLD = 0; // All closed = healthy
export const DEGRADED_THRESHOLD = 1; // Any half-open or 1 open = degraded
// More than 1 open = critical
