const labels: Record<string, string> = {
  pending: "等待中",
  queued: "佇列中",
  running: "執行中",
  waiting_worker: "等待執行",
  expired: "已逾時",
  completed: "已完成",
  cancel_requested: "取消中",
  cancelled: "已取消",
  succeeded: "成功",
  failed: "失敗",
  scheduled: "已排程",
  publishing: "發文中",
  published: "已發布",
  draft: "草稿"
};

export function jobStatusLabel(status?: string) {
  if (!status) return "未知";
  return labels[status] || status;
}

export function jobStatusBadgeClass(status?: string) {
  switch (status) {
    case "succeeded":
    case "published":
      return "success";
    case "running":
    case "queued":
    case "publishing":
      return "brand";
    case "pending":
    case "scheduled":
    case "waiting_worker":
      return "warning";
    case "failed":
    case "cancelled":
    case "cancel_requested":
      return "danger";
    default:
      return "neutral";
  }
}
