mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 10:10:57 +00:00
fix data table
This commit is contained in:
@@ -26,6 +26,7 @@ export const formatFleetCell = (
|
||||
const status = value == null || value === "" ? "—" : String(value);
|
||||
const getStatusColor = (st: string): string => {
|
||||
const s = st.toUpperCase();
|
||||
console.log('Status for color mapping:', s);
|
||||
if (s === "ACTIVE") return "green";
|
||||
if (s === "INACTIVE") return "gray";
|
||||
if (s === "SUSPENDED" || s === "OUT_OF_SERVICE") return "red";
|
||||
@@ -33,8 +34,10 @@ export const formatFleetCell = (
|
||||
if (s === "RETIRED") return "gray";
|
||||
return "gray";
|
||||
};
|
||||
const color = getStatusColor(status);
|
||||
console.log('Assigned color:', color, 'for status:', status);
|
||||
return (
|
||||
<Badge variant="light" color={getStatusColor(status)} size="sm" radius="md">
|
||||
<Badge variant="light" color={color} size="sm" radius="md">
|
||||
{status}
|
||||
</Badge>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user