export default function StatusBadge({ status }: { status: string }) {
  const styles: Record<string, string> = {
    unprocessed: "border-slate-200 bg-slate-50 text-slate-700",
    processing: "border-cyan-200 bg-cyan-50 text-cyan-700",
    parsed: "border-indigo-200 bg-indigo-50 text-indigo-700",
    pending_review: "border-amber-200 bg-amber-50 text-amber-700",
    completed: "border-emerald-200 bg-emerald-50 text-emerald-700",
    failed: "border-rose-200 bg-rose-50 text-rose-700",
    pending: "border-amber-200 bg-amber-50 text-amber-700",
    approved: "border-emerald-200 bg-emerald-50 text-emerald-700",
    rejected: "border-slate-200 bg-slate-50 text-slate-700",
    forbidden: "border-rose-200 bg-rose-50 text-rose-700",
    callable: "border-emerald-200 bg-emerald-50 text-emerald-700",
    not_callable: "border-slate-200 bg-slate-50 text-slate-700",
    need_review: "border-amber-200 bg-amber-50 text-amber-700",
    success: "border-emerald-200 bg-emerald-50 text-emerald-700",
    partial_success: "border-orange-200 bg-orange-50 text-orange-700",
    running: "border-cyan-200 bg-cyan-50 text-cyan-700"
  };
  const labels: Record<string, string> = {
    unprocessed: "未处理",
    processing: "处理中",
    parsed: "已拆解",
    pending_review: "待审核",
    completed: "已完成",
    failed: "失败",
    pending: "待审核",
    reviewing: "审核中",
    approved: "已通过",
    needs_revision: "需修改",
    rejected: "不入库",
    forbidden: "禁止",
    callable: "可调用",
    not_callable: "暂不调用",
    need_review: "需复审",
    success: "成功",
    partial_success: "部分成功",
    running: "运行中"
  };
  return (
    <span className={`inline-flex rounded-md border px-2 py-1 text-xs font-medium ${styles[status] ?? styles.pending}`}>
      {labels[status] ?? status}
    </span>
  );
}

