import { cn } from '@/lib/cn'
import { ContractPhaseColor, ContractPhaseLabel } from '@/types/contracts'

// Density-first status pill (NAMGROUP convention): rounded-full, ring-bordered,
// 11px semibold. Tint + text colour come from ContractPhaseColor (bg-{c}-100 /
// text-{c}-700); a matching inset ring crisps the edge without a new colour map.
export function PhaseBadge({ phase, className }: { phase: number; className?: string }) {
  return (
    <span
      className={cn(
        'inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-semibold ring-1 ring-inset ring-current/15',
        ContractPhaseColor[phase],
        className,
      )}
    >
      {ContractPhaseLabel[phase]}
    </span>
  )
}
