mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 04:15:43 +00:00
fix data table
This commit is contained in:
@@ -93,7 +93,7 @@ const FleetResourcePage = () => {
|
|||||||
const usesServerListFilters = Boolean(config?.listFilters?.length);
|
const usesServerListFilters = Boolean(config?.listFilters?.length);
|
||||||
|
|
||||||
const statusFilterOptions = useMemo(() => {
|
const statusFilterOptions = useMemo(() => {
|
||||||
if (!hasStatusColumn || usesServerListFilters) return [];
|
if (!hasStatusColumn || usesServerListFilters || slug === "vehicles" || slug === "drivers") return [];
|
||||||
const statuses = new Set(
|
const statuses = new Set(
|
||||||
allRows
|
allRows
|
||||||
.map((row) => String((row as unknown as Record<string, unknown>).status ?? ""))
|
.map((row) => String((row as unknown as Record<string, unknown>).status ?? ""))
|
||||||
@@ -103,7 +103,7 @@ const FleetResourcePage = () => {
|
|||||||
{ value: "ALL", label: "All statuses" },
|
{ value: "ALL", label: "All statuses" },
|
||||||
...[...statuses].sort().map((status) => ({ value: status, label: status })),
|
...[...statuses].sort().map((status) => ({ value: status, label: status })),
|
||||||
];
|
];
|
||||||
}, [allRows, hasStatusColumn, usesServerListFilters]);
|
}, [allRows, hasStatusColumn, usesServerListFilters, slug]);
|
||||||
|
|
||||||
const dynamicOptions = useMemo(() => {
|
const dynamicOptions = useMemo(() => {
|
||||||
const wagonTypeOpts = (wagonTypes as Array<{ id: string; code: string; name?: string }>).map(
|
const wagonTypeOpts = (wagonTypes as Array<{ id: string; code: string; name?: string }>).map(
|
||||||
|
|||||||
Reference in New Issue
Block a user