import type { BadgeTone } from "../components/ui";

export type FirstRunStatusKey = "pending" | "skipped" | "completed";

export function normalizeFirstRunStatus(status?: string): FirstRunStatusKey {
  if (status === "skipped" || status === "completed") return status;
  return "pending";
}

export function firstRunStatusTone(status?: string): BadgeTone {
  const key = normalizeFirstRunStatus(status);
  if (key === "completed") return "success";
  if (key === "skipped") return "neutral";
  return "warning";
}

export function firstRunStatusLabelKey(status?: string): string {
  return `firstRun.status.${normalizeFirstRunStatus(status)}`;
}
