import { Badge, type BadgeProps } from '@/components/ui/badge'
import type { DealStatus } from '@/types/crm'

export const dealStatusLabels: Record<DealStatus, string> = {
  new: 'Новая',
  in_progress: 'В работе',
  won: 'Успех',
  lost: 'Закрыта',
}

const statusVariant: Record<DealStatus, BadgeProps['variant']> = {
  new: 'warning',
  in_progress: 'secondary',
  won: 'success',
  lost: 'destructive',
}

interface DealStatusBadgeProps {
  status: DealStatus
}

export const DealStatusBadge = ({ status }: DealStatusBadgeProps) => <Badge variant={statusVariant[status]}>{dealStatusLabels[status]}</Badge>
