import React from 'react'

import { Badge } from '@/components/ui/badge'

import { useTableUtils } from '../hooks/useTableUtils'
import type { StatusBadgeProps } from '../types'

// Компонент для статуса поставки
export const StatusBadge = React.memo(function StatusBadge({ status }: StatusBadgeProps) {
  const { getStatusColor, getStatusText } = useTableUtils()

  return (
    <Badge className={`${getStatusColor(status)} border text-xs`}>
      {getStatusText(status)}
    </Badge>
  )
})