import { Badge } from 'antd'
import { useTranslation } from 'react-i18next'

// StatusDot replaces the `Yes/No` text columns with the AntD Badge
// pattern from the old EdgeGuard — a small coloured dot + label,
// scans much faster in long tables.
interface StatusDotProps {
  active: boolean
  activeLabel?: string
  inactiveLabel?: string
}

export default function StatusDot({ active, activeLabel, inactiveLabel }: StatusDotProps) {
  const { t } = useTranslation()
  return (
    <Badge
      status={active ? 'success' : 'default'}
      text={active ? (activeLabel ?? t('common.active')) : (inactiveLabel ?? t('common.inactive'))}
    />
  )
}
