Files
explore/ui/tokenTransfers/TokenTransfersTable.tsx
9a977d191b Fixes for release v2.5.0 (#3142)
* fail the app start if multichain config or essential dapps config were not generated properly

* add timeouts for essential dapps and multichain config generators

* fix "add to wallet" button in address tokens table

* [skip ci] update docs

* fix tx tables when there are no fee and value columns

* add support for promoted multichain provider

* fixes

* change action button logic

* fix tests

* fix

* hide "add network" button for multichain

* shorten the amount of txs on multichain homepage

* change name formatting for multichain button

* add bright color variants and lg size for badges

* fix y-axis margin calculation for chart with custom tick formatter

* superchain bug fixes

* bump versions of react and nextjs

* update screenshot

* bump dappscout-iframe

---------

Co-authored-by: Max Alekseenko <[email protected]>
2025-12-04 18:44:01 +01:00

52 lines
1.8 KiB
TypeScript

import React from 'react';
import type { TokenTransfer } from 'types/api/tokenTransfer';
import type { ClusterChainConfig } from 'types/multichain';
import { AddressHighlightProvider } from 'lib/contexts/addressHighlight';
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
import TokenTransferTableItem from 'ui/tokenTransfers/TokenTransfersTableItem';
interface Props {
items?: Array<TokenTransfer>;
top: number;
isLoading?: boolean;
chainData?: ClusterChainConfig;
}
const TokenTransferTable = ({ items, top, isLoading, chainData }: Props) => {
return (
<AddressHighlightProvider>
<TableRoot minW="950px" tableLayout="auto">
<TableHeaderSticky top={ top }>
<TableRow>
{ chainData && <TableColumnHeader width="38px"/> }
<TableColumnHeader>
Txn hash
<TimeFormatToggle/>
</TableColumnHeader>
<TableColumnHeader>Method</TableColumnHeader>
<TableColumnHeader>Block</TableColumnHeader>
<TableColumnHeader>From/To</TableColumnHeader>
<TableColumnHeader>Token ID</TableColumnHeader>
<TableColumnHeader isNumeric>Amount</TableColumnHeader>
</TableRow>
</TableHeaderSticky>
<TableBody>
{ items?.map((item, index) => (
<TokenTransferTableItem
key={ item.transaction_hash + item.log_index + (isLoading ? index : '') + (chainData ? chainData.id : '') }
item={ item }
isLoading={ isLoading }
chainData={ chainData }
/>
)) }
</TableBody>
</TableRoot>
</AddressHighlightProvider>
);
};
export default React.memo(TokenTransferTable);