import { Chip } from '@mui/material'
import { confidenceHex } from '../../lib/utils'

interface Props {
  confidence: number
  size?: 'small' | 'medium'
}

export function ConfidenceFieldBadge({ confidence, size = 'small' }: Props) {
  return (
    <Chip
      label={`${Math.round(confidence * 100)}%`}
      size={size}
      sx={{ bgcolor: confidenceHex(confidence), color: 'white', fontWeight: 700, fontSize: 11 }}
    />
  )
}
