diff --git a/app/missions/page.tsx b/app/missions/page.tsx index be50138d..90955e5a 100644 --- a/app/missions/page.tsx +++ b/app/missions/page.tsx @@ -27,6 +27,8 @@ interface Mission { niveau: string; missionType: string; projection: string; + participation?: string; + services?: string[]; createdAt: string; creator: User; missionUsers: MissionUser[]; @@ -82,11 +84,62 @@ export default function MissionsPage() { }); }; - // Function to get mission category - const getCategory = (mission: Mission) => { - return mission.oddScope && mission.oddScope.length > 0 - ? mission.oddScope[0].replace('odd-', 'ODD ') - : "Non catégorisé"; + // Function to get mission category and icon + const getODDInfo = (mission: Mission) => { + const oddCode = mission.oddScope && mission.oddScope.length > 0 + ? mission.oddScope[0] + : null; + + // Extract number from odd code (e.g., "odd-3" -> "3") + const oddNumber = oddCode ? oddCode.replace('odd-', '') : null; + + return { + number: oddNumber, + label: oddNumber ? `ODD ${oddNumber}` : "Non catégorisé", + iconPath: oddNumber ? `/images/odd/odd-${oddNumber}.png` : "/images/odd/default.png" + }; + }; + + // Function to get appropriate badge color based on niveau + const getNiveauBadgeColor = (niveau: string) => { + switch(niveau) { + case 'a': return 'bg-green-100 text-green-800'; + case 'b': return 'bg-blue-100 text-blue-800'; + case 'c': return 'bg-purple-100 text-purple-800'; + case 's': return 'bg-amber-100 text-amber-800'; + default: return 'bg-gray-100 text-gray-800'; + } + }; + + // Function to get full niveau label + const getNiveauLabel = (niveau: string) => { + switch(niveau) { + case 'a': return 'A- Apprentissage'; + case 'b': return 'B- Basique'; + case 'c': return 'C- Complexe'; + case 's': return 'S- Spécial'; + default: return niveau; + } + }; + + // Function to get mission type label + const getMissionTypeLabel = (type: string) => { + switch(type) { + case 'remote': return 'À distance'; + case 'onsite': return 'Sur site'; + case 'hybrid': return 'Hybride'; + default: return type; + } + }; + + // Function to get participation label + const getParticipationLabel = (participation: string | null | undefined) => { + if (!participation) return 'Non spécifié'; + switch(participation) { + case 'volontaire': return 'Volontaire'; + case 'cooptation': return 'Cooptation'; + default: return participation; + } }; // Function to get mission duration @@ -101,74 +154,141 @@ export default function MissionsPage() { return (
Type: {mission.missionType}
+Aucune mission trouvée
++ Créez votre première mission pour commencer à organiser vos projets et inviter des participants. +
-