mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
fix data table
This commit is contained in:
@@ -24,8 +24,17 @@ export const formatFleetCell = (
|
|||||||
|
|
||||||
if (format === "statusBadge") {
|
if (format === "statusBadge") {
|
||||||
const status = value == null || value === "" ? "—" : String(value);
|
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 (
|
return (
|
||||||
<Badge variant="light" color="gray" size="sm" radius="md">
|
<Badge variant="light" color={getStatusColor(status)} size="sm" radius="md">
|
||||||
{status}
|
{status}
|
||||||
</Badge>
|
</Badge>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user