fix data table

This commit is contained in:
natib21
2026-06-20 09:17:03 +00:00
parent 926e72ad74
commit f312a79ca8

View File

@@ -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 (
<Badge variant="light" color="gray" size="sm" radius="md">
<Badge variant="light" color={getStatusColor(status)} size="sm" radius="md">
{status}
</Badge>
);