Files
explore/ui/withdrawals/optimisticL2/OptimisticL2WithdrawalsTable.tsx
tom goriunovandGitHub 14b7bf07e7 Move layer numbering to the ENV (#3278)
* Rollups: move layer numbering to the ENV

Resolves #2554

* fix review comments
2026-02-25 14:54:39 +01:00

51 lines
1.8 KiB
TypeScript

import React from 'react';
import type { OptimisticL2WithdrawalsItem } from 'types/api/optimisticL2';
import { AddressHighlightProvider } from 'lib/contexts/addressHighlight';
import { layerLabels } from 'lib/rollups/utils';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import OptimisticL2WithdrawalsTableItem from './OptimisticL2WithdrawalsTableItem';
type Props = {
items: Array<OptimisticL2WithdrawalsItem>;
top: number;
isLoading?: boolean;
};
const OptimisticL2WithdrawalsTable = ({ items, top, isLoading }: Props) => {
return (
<AddressHighlightProvider>
<TableRoot tableLayout="auto" minW="950px">
<TableHeaderSticky top={ top }>
<TableRow>
<TableColumnHeader>Msg nonce</TableColumnHeader>
<TableColumnHeader>From</TableColumnHeader>
<TableColumnHeader>{ layerLabels.current } txn hash</TableColumnHeader>
<TableColumnHeader>
Timestamp
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>Status</TableColumnHeader>
<TableColumnHeader>{ layerLabels.parent } txn hash</TableColumnHeader>
<TableColumnHeader>Time left</TableColumnHeader>
</TableRow>
</TableHeaderSticky>
<TableBody>
{ items.map((item, index) => (
<OptimisticL2WithdrawalsTableItem
key={ String(item.msg_nonce_version) + item.msg_nonce + (isLoading ? index : '') }
item={ item }
isLoading={ isLoading }
/>
)) }
</TableBody>
</TableRoot>
</AddressHighlightProvider>
);
};
export default OptimisticL2WithdrawalsTable;