
import React from 'react';
import { cn } from '@/lib/utils';



const labelsCommande = {
  0: { label: 'Préparation', color: 'bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300' },
  1: { label: 'En cours', color: 'bg-yellow-100 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-300' },
  2: { label: 'Livrée', color: 'bg-green-100 dark:bg-green-900/20 text-green-700 dark:text-green-300' },
  5: { label: 'Facturée', color: 'bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300' },
}

const StatusBadgeCommande = ({ status }) => {
  const info = labelsCommande[status];

  return (
    <span
      className={cn(
        "inline-flex items-center px-2.5 py-0.5 rounded-lg text-xs font-medium",
        info?.color ?? "bg-gray-200 text-gray-700"
      )}
    >
      {info?.label ?? `Statut ${status}`}
    </span>
  );
};

export default StatusBadgeCommande;