fuel test

This commit is contained in:
2025-10-31 12:25:42 +09:00
parent 78998ad4a4
commit 67f519233d

View File

@ -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() {
</Dialog>
</div>
{tables.map((table, index) => {
if (table.value === currentTab.value) {
return (
isLoading ?
<div style={{ display: 'flex', width: '100%', justifyContent: 'center', padding: '1rem' }}>
<Spinner />
</div>
:
<div style={{ width: '100%', height: '100%', padding: '1rem' }}>
<AgGridReact
key={index}
//rowData={data}
rowData={[
Object.keys(table.headers).reduce((obj, key) => ({ ...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,
}}
/>
</div>
)
<div style={{
width: '100%',
height: '100%',
overflow: 'auto'
}}>
{tables.map((table, index) => {
if (table.value === currentTab.value) {
return (
isLoading ?
<div style={{ display: 'flex', width: '100%', justifyContent: 'center', padding: '1rem' }}>
<Spinner />
</div>
:
<div style={{ overflow: 'auto', width: '100%', height: '100%', padding: '1rem' }}>
<AgGridReact
key={index}
//rowData={data}
// rowData={[
// Object.keys(table.headers).reduce((obj, key) => ({ ...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,
}}
/>
</div>
)
}
}
}
)}
)}
</div>
</div>
</>
)