import { User, Building2 } from 'lucide-react';
import type { PartnerType } from '../types';

interface PartnerTypeBadgeProps {
  type: PartnerType;
  isCustomer?: boolean;
  isSupplier?: boolean;
}

export function PartnerTypeBadge({ type, isCustomer, isSupplier }: PartnerTypeBadgeProps) {
  const roles: string[] = [];
  if (isCustomer) roles.push('Cliente');
  if (isSupplier) roles.push('Proveedor');

  return (
    <div className="flex flex-col gap-1">
      <span
        className={`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${
          type === 'company'
            ? 'bg-blue-100 text-blue-800'
            : 'bg-purple-100 text-purple-800'
        }`}
      >
        {type === 'company' ? (
          <Building2 className="h-3 w-3" />
        ) : (
          <User className="h-3 w-3" />
        )}
        {type === 'company' ? 'Empresa' : 'Persona'}
      </span>
      {roles.length > 0 && (
        <span className="text-xs text-gray-500">
          {roles.join(' / ')}
        </span>
      )}
    </div>
  );
}
