31 lines
1.6 KiB
JavaScript
31 lines
1.6 KiB
JavaScript
export const statusConfig = {
|
|
draft: { label: 'Brouillon', class: 'bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200' },
|
|
pending_rh_validation: { label: 'Attente validation RH', class: 'bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300' },
|
|
in_progress: { label: 'En cours', class: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300 animate-pulse' },
|
|
waiting_services: { label: 'Attente Services', class: 'bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300' },
|
|
completed: { label: 'Terminé', class: 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300' },
|
|
cancelled: { label: 'Annulé', class: 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300' },
|
|
rejected: { label: 'Refusé', class: 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300' },
|
|
pending: { label: 'En attente', class: 'bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200' },
|
|
waiting_validation: { label: 'Attente Validation', class: 'bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300 animate-pulse' },
|
|
};
|
|
|
|
export const getStatusLabel = (status) => {
|
|
return statusConfig[status]?.label || status;
|
|
};
|
|
|
|
export const modelLabels = {
|
|
'IntegrationRequest': 'Fiche Agent',
|
|
'ServiceTask': 'Tâche Service',
|
|
'Comment': 'Commentaire',
|
|
'Upload': 'Fichier',
|
|
'User': 'Utilisateur',
|
|
'Agent': 'Agent',
|
|
};
|
|
|
|
export const getModelLabel = (modelName) => {
|
|
// Handle both full namespace and short name
|
|
const shortName = modelName.split('\\').pop();
|
|
return modelLabels[shortName] || shortName;
|
|
};
|