import type { CourseStatus } from '../types'

const statusMap: Record<CourseStatus, { label: string; className: string }> = {
  DRAFT: { label: '准备素材', className: 'status--draft' },
  WAITING_PRODUCTION: { label: '等待制作', className: 'status--waiting_production' },
  IN_PRODUCTION: { label: '制作中', className: 'status--in_production' },
  COMPLETED: { label: '制作完成', className: 'status--completed' },
  REJECTED: { label: '已驳回', className: 'status--rejected' }
}

export function StatusBadge({ status }: { status: CourseStatus }) {
  const current = statusMap[status] || { label: status, className: 'status--unknown' }
  return (
    <span className={`status ${current.className}`}>
      <i />
      {current.label}
    </span>
  )
}
