Files
explore/ui/txnBatches/arbitrumL2/ArbitrumL2TxnBatchesTable.tsx
tom goriunovandGitHub f982eb07a0 Time format toggle for table views (#2729)
* cookie for storing time format value

* rename TimeAgo component

* add toggle to tables (pt. 1)

* move TimeWithTooltip component

* add toggle to tables (pt. 2)

* change implementation of toggle component

* remove unnecessary timestamp label

* update screenshots

* more screenshot updates

* [skip ci] update clock icon

* update screenshots
2025-06-03 14:01:12 +02:00

47 lines
1.5 KiB
TypeScript

import React from 'react';
import type { ArbitrumL2TxnBatchesItem } from 'types/api/arbitrumL2';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import ArbitrumL2TxnBatchesTableItem from './ArbitrumL2TxnBatchesTableItem';
type Props = {
items: Array<ArbitrumL2TxnBatchesItem>;
top: number;
isLoading?: boolean;
};
const ArbitrumL2TxnBatchesTable = ({ items, top, isLoading }: Props) => {
return (
<TableRoot tableLayout="auto" minW="1000px">
<TableHeaderSticky top={ top }>
<TableRow>
<TableColumnHeader>Batch #</TableColumnHeader>
<TableColumnHeader>L1 status</TableColumnHeader>
<TableColumnHeader>L1 block</TableColumnHeader>
<TableColumnHeader>Block count</TableColumnHeader>
<TableColumnHeader>L1 transaction</TableColumnHeader>
<TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>Txn count</TableColumnHeader>
</TableRow>
</TableHeaderSticky>
<TableBody>
{ items.map((item, index) => (
<ArbitrumL2TxnBatchesTableItem
key={ item.number + (isLoading ? String(index) : '') }
item={ item }
isLoading={ isLoading }
/>
)) }
</TableBody>
</TableRoot>
);
};
export default ArbitrumL2TxnBatchesTable;