From f312a79ca84ea804e697af4471a0a49c0966d2c2 Mon Sep 17 00:00:00 2001 From: natib21 Date: Sat, 20 Jun 2026 09:17:03 +0000 Subject: [PATCH] fix data table --- .../backoffice/src/components/fleet/fleetFormat.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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} );