From 67f519233df5d98232b0d21bcd210289dc340978 Mon Sep 17 00:00:00 2001 From: popovspiridon99 Date: Fri, 31 Oct 2025 12:25:42 +0900 Subject: [PATCH] fuel test --- client/src/pages/Fuel.tsx | 64 ++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/client/src/pages/Fuel.tsx b/client/src/pages/Fuel.tsx index 36c389a..6f919e3 100644 --- a/client/src/pages/Fuel.tsx +++ b/client/src/pages/Fuel.tsx @@ -92,7 +92,7 @@ export default function FuelPage() { const [currentTab, setCurrentTab] = useState(tables[0]) - const { isLoading } = useSWR(currentTab.get, () => fetcher(currentTab.get), { revalidateOnFocus: false }) + const { data, isLoading } = useSWR(currentTab.get, () => fetcher(currentTab.get), { revalidateOnFocus: false }) const { colorScheme } = useAppStore() @@ -134,34 +134,42 @@ export default function FuelPage() { - {tables.map((table, index) => { - if (table.value === currentTab.value) { - return ( - isLoading ? -
- -
- : -
- ({ ...obj, [key]: 'test' }), {}), - Object.keys(table.headers).reduce((obj, key) => ({ ...obj, [key]: 'test' }), {}) - ]} - columnDefs={Object.keys(table.headers).map((header) => ({ - field: header - })) as ColDef[]} - defaultColDef={{ - flex: 1, - }} - /> -
- ) +
+ {tables.map((table, index) => { + if (table.value === currentTab.value) { + return ( + isLoading ? +
+ +
+ : +
+ ({ ...obj, [key]: 'test' }), {}), + // Object.keys(table.headers).reduce((obj, key) => ({ ...obj, [key]: 'test' }), {}) + // ]} + rowData={data} + columnDefs={Object.keys(table.headers).map((header) => ({ + field: header + })) as ColDef[]} + defaultColDef={{ + flex: 1, + }} + /> +
+ ) + } } - } - )} + )} +
+ )