mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* Rollups: move layer numbering to the ENV Resolves #2554 * fix review comments
47 lines
1.5 KiB
TypeScript
47 lines
1.5 KiB
TypeScript
import React from 'react';
|
|
|
|
import type { OptimisticL2TxnBatchesItem } from 'types/api/optimisticL2';
|
|
|
|
import { layerLabels } from 'lib/rollups/utils';
|
|
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
|
|
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
|
|
|
|
import OptimisticL2TxnBatchesTableItem from './OptimisticL2TxnBatchesTableItem';
|
|
|
|
type Props = {
|
|
items: Array<OptimisticL2TxnBatchesItem>;
|
|
top: number;
|
|
isLoading?: boolean;
|
|
};
|
|
|
|
const OptimisticL2TxnBatchesTable = ({ items, top, isLoading }: Props) => {
|
|
return (
|
|
<TableRoot tableLayout="auto" minW="850px">
|
|
<TableHeaderSticky top={ top }>
|
|
<TableRow>
|
|
<TableColumnHeader>Batch ID</TableColumnHeader>
|
|
<TableColumnHeader>Storage</TableColumnHeader>
|
|
<TableColumnHeader>
|
|
Timestamp
|
|
<TimeFormatToggle/>
|
|
</TableColumnHeader>
|
|
<TableColumnHeader isNumeric>{ layerLabels.parent } txn count</TableColumnHeader>
|
|
<TableColumnHeader isNumeric>{ layerLabels.current } blocks</TableColumnHeader>
|
|
<TableColumnHeader isNumeric>Txn</TableColumnHeader>
|
|
</TableRow>
|
|
</TableHeaderSticky>
|
|
<TableBody>
|
|
{ items.map((item, index) => (
|
|
<OptimisticL2TxnBatchesTableItem
|
|
key={ item.number + (isLoading ? String(index) : '') }
|
|
item={ item }
|
|
isLoading={ isLoading }
|
|
/>
|
|
)) }
|
|
</TableBody>
|
|
</TableRoot>
|
|
);
|
|
};
|
|
|
|
export default OptimisticL2TxnBatchesTable;
|