diff --git a/apps/edr-freight-web/backoffice/src/components/fleet/fleetFormat.tsx b/apps/edr-freight-web/backoffice/src/components/fleet/fleetFormat.tsx index 1d558b2fb..b050da449 100644 --- a/apps/edr-freight-web/backoffice/src/components/fleet/fleetFormat.tsx +++ b/apps/edr-freight-web/backoffice/src/components/fleet/fleetFormat.tsx @@ -24,8 +24,17 @@ export const formatFleetCell = ( if (format === "statusBadge") { const status = value == null || value === "" ? "—" : String(value); + const getStatusColor = (st: string): string => { + const s = st.toUpperCase(); + if (s === "ACTIVE") return "green"; + if (s === "INACTIVE") return "gray"; + if (s === "SUSPENDED" || s === "OUT_OF_SERVICE") return "red"; + if (s === "MAINTENANCE" || s === "ON_LEAVE") return "orange"; + if (s === "RETIRED") return "gray"; + return "gray"; + }; return ( - + {status} );