import type { IntelligentEvalSessionStatus, IntelligentEvalStatus } from '../../api'

export const EVAL_STATUS: Record<IntelligentEvalStatus, { label: string; color: string }> = {
  draft: { label: '草稿', color: 'default' },
  planning: { label: '规划中', color: 'processing' },
  pending_approval: { label: '待审批', color: 'warning' },
  executing: { label: '执行中', color: 'processing' },
  completed: { label: '已完成', color: 'success' },
  cancelled: { label: '已取消', color: 'default' },
  failed: { label: '失败', color: 'error' },
}

export const SESSION_STATUS: Record<IntelligentEvalSessionStatus, { label: string; color: string }> = {
  running: { label: '进行中', color: 'processing' },
  completed: { label: '已完成', color: 'success' },
  failed: { label: '失败', color: 'error' },
  expired: { label: '已过期', color: 'default' },
}

export const SEVERITY_META: Record<string, { label: string; color: string; order: number }> = {
  high: { label: '高', color: 'red', order: 0 },
  medium: { label: '中', color: 'orange', order: 1 },
  low: { label: '低', color: 'blue', order: 2 },
}

export function severityOf(severity: string) {
  return SEVERITY_META[severity?.toLowerCase()] ?? { label: severity, color: 'default', order: 99 }
}
