import type { PropertyStatus } from '@/lib/validations/property'

const COLORS: Record<PropertyStatus, { bg: string; text: string; label: string }> = {
  ACTIVE: { bg: 'bg-green-100', text: 'text-green-800', label: 'Active' },
  RESERVED: { bg: 'bg-yellow-100', text: 'text-yellow-800', label: 'Reserved' },
  NEGOTIATING: { bg: 'bg-orange-100', text: 'text-orange-800', label: 'Negotiating' },
  OFFER_PENDING: { bg: 'bg-purple-100', text: 'text-purple-800', label: 'Offer pending' },
  SOLD: { bg: 'bg-blue-100', text: 'text-blue-800', label: 'Sold' },
  OFF_MARKET: { bg: 'bg-gray-100', text: 'text-gray-800', label: 'Off market' },
  ARCHIVED: { bg: 'bg-slate-100', text: 'text-slate-600', label: 'Archived' },
}

/**
 * Badge para estados de Property (pipeline interno de ventas).
 * Distinto del StatusBadge de Listing (otro enum).
 */
export function PropertyStatusBadge({ status }: { status: PropertyStatus }) {
  const c = COLORS[status] ?? COLORS.ACTIVE
  return (
    <span
      className={`inline-block px-2 py-1 rounded text-xs font-medium ${c.bg} ${c.text}`}
    >
      {c.label}
    </span>
  )
}