import { COMMODITY_SYMBOLS, COMMODITY_LABELS, type Commodity } from '@/lib/constants'

export function CommodityBadge({ code }: { code: string }) {
  const c = code as Commodity
  return (
    <span
      title={COMMODITY_LABELS[c] ?? code}
      className="inline-flex h-6 min-w-6 items-center justify-center rounded-full bg-amber-brand/15 px-2 text-xs font-semibold text-amber-brand"
    >
      {COMMODITY_SYMBOLS[c] ?? code}
    </span>
  )
}
