export const stageOrder = ["script", "base_assets", "storyboard", "video", "export"] as const;

export const stageMeta: Record<string, { no: string; label: string }> = {
  script: { no: "1", label: "脚本" },
  base_assets: { no: "2", label: "基础资产" },
  storyboard: { no: "3", label: "故事板" },
  video: { no: "4", label: "视频片段" },
  export: { no: "5", label: "拼接导出" }
};

export function money(value: string | number | undefined) {
  if (value === undefined || value === "") return "¥0.00";
  const n = Number(value);
  return Number.isFinite(n) ? `¥${n.toFixed(2)}` : `¥${value}`;
}

export function statusPill(status: string) {
  if (["succeeded", "completed", "done", "ok", "skipped"].includes(status)) return "ok";
  if (["failed", "error"].includes(status)) return "err";
  if (["running", "queued", "needs_review", "polling"].includes(status)) return "info";
  return "neutral";
}
