import type { OrgStatus } from '../api/client'

export const STATUS_LABELS: Record<OrgStatus, string> = {
  INFO_PENDING: '정보 대기',
  READY: '생성 가능',
  PARTIAL: '부분 생성',
  ACTIVE: '운영 중',
}

/** 접힌 목록 등 좁은 자리에서 뱃지 대신 쓰는 상태 점 색 */
export const STATUS_DOT: Record<OrgStatus, string> = {
  INFO_PENDING: 'bg-gray-300',
  READY: 'bg-blue-500',
  PARTIAL: 'bg-amber-500',
  ACTIVE: 'bg-emerald-500',
}

const LABELS = STATUS_LABELS

const STYLES: Record<OrgStatus, string> = {
  INFO_PENDING: 'bg-gray-100 text-gray-600',
  READY: 'bg-blue-50 text-blue-700',
  PARTIAL: 'bg-amber-50 text-amber-700',
  ACTIVE: 'bg-emerald-50 text-emerald-700',
}

export default function StatusBadge({ status }: { status: OrgStatus }) {
  return (
    <span className={`rounded-full px-2 py-0.5 text-xs font-medium ${STYLES[status]}`}>
      {LABELS[status]}
    </span>
  )
}
