fuel test
This commit is contained in:
@ -92,7 +92,7 @@ export default function FuelPage() {
|
|||||||
|
|
||||||
const [currentTab, setCurrentTab] = useState(tables[0])
|
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()
|
const { colorScheme } = useAppStore()
|
||||||
|
|
||||||
@ -134,34 +134,42 @@ export default function FuelPage() {
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{tables.map((table, index) => {
|
<div style={{
|
||||||
if (table.value === currentTab.value) {
|
width: '100%',
|
||||||
return (
|
height: '100%',
|
||||||
isLoading ?
|
overflow: 'auto'
|
||||||
<div style={{ display: 'flex', width: '100%', justifyContent: 'center', padding: '1rem' }}>
|
}}>
|
||||||
<Spinner />
|
{tables.map((table, index) => {
|
||||||
</div>
|
if (table.value === currentTab.value) {
|
||||||
:
|
return (
|
||||||
<div style={{ width: '100%', height: '100%', padding: '1rem' }}>
|
isLoading ?
|
||||||
<AgGridReact
|
<div style={{ display: 'flex', width: '100%', justifyContent: 'center', padding: '1rem' }}>
|
||||||
key={index}
|
<Spinner />
|
||||||
//rowData={data}
|
</div>
|
||||||
rowData={[
|
:
|
||||||
Object.keys(table.headers).reduce((obj, key) => ({ ...obj, [key]: 'test' }), {}),
|
<div style={{ overflow: 'auto', width: '100%', height: '100%', padding: '1rem' }}>
|
||||||
Object.keys(table.headers).reduce((obj, key) => ({ ...obj, [key]: 'test' }), {})
|
<AgGridReact
|
||||||
]}
|
key={index}
|
||||||
columnDefs={Object.keys(table.headers).map((header) => ({
|
//rowData={data}
|
||||||
field: header
|
// rowData={[
|
||||||
})) as ColDef[]}
|
// Object.keys(table.headers).reduce((obj, key) => ({ ...obj, [key]: 'test' }), {}),
|
||||||
defaultColDef={{
|
// Object.keys(table.headers).reduce((obj, key) => ({ ...obj, [key]: 'test' }), {})
|
||||||
flex: 1,
|
// ]}
|
||||||
}}
|
rowData={data}
|
||||||
/>
|
columnDefs={Object.keys(table.headers).map((header) => ({
|
||||||
</div>
|
field: header
|
||||||
)
|
})) as ColDef[]}
|
||||||
|
defaultColDef={{
|
||||||
|
flex: 1,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
)}
|
||||||
)}
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user