// Helper functions for task status display

export const getTaskStatusLabel = (status) => {
  const statuses = {
    'submitted': 'Enviado',
    'pending': 'Pendiente',
    'processing': 'Procesando',
    'completed': 'Completado',
    'failed': 'Error',
    'cancelled': 'Cancelado'
  };
  return statuses[status] || `Estado ${status}`;
};

export const getTaskStatusColor = (status) => {
  const colors = {
    'submitted': 'bg-blue-100 text-blue-800',
    'pending': 'bg-yellow-100 text-yellow-800',
    'processing': 'bg-indigo-100 text-indigo-800',
    'completed': 'bg-green-100 text-green-800', 
    'failed': 'bg-red-100 text-red-800',
    'cancelled': 'bg-gray-100 text-gray-800'
  };
  return colors[status] || 'bg-gray-100 text-gray-800';
};

// Ayuda a determinar si el estado permite ciertas acciones
export const isTaskActionable = (status) => {
  const nonActionableStatuses = ['processing', 'completed', 'cancelled'];
  return !nonActionableStatuses.includes(status);
};

export const isTaskFinal = (status) => {
  const finalStatuses = ['completed', 'failed', 'cancelled'];
  return finalStatuses.includes(status);
};