fix data table

This commit is contained in:
natib21
2026-06-20 09:19:08 +00:00
parent f312a79ca8
commit 739442c9bc

View File

@@ -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>
);