Files
explore/ui/crossChain/transfers/TokenTransfersCrossChainContent.tsx
tom goriunovandGitHub e6e83ee4e7 Add cross-chain transaction tracking and visualization (#3227)
* envs and feature setup

* home page layout

* cross-chain txs page

* cross-chain transfers page

* cross-chain transfers on tx page

* cross-chain messages on tx page

* cross-chain tx page

* cross-chain tx details token transfers

* stats and counters for lists

* migrate to new API version

* add swagger

* mobile lists

* placeholder views on address page

* tests

* fix adaptive tabs initial state when there is only one tab in the list

* tweaks

* bug fixes

* fix tests

* update screenshots

* migrate to new api version

* add chain label tooltip, copy button to txs in lists and same address highlight

* list views on address page

* fix tests

* fix links to current address in the list views

* update tooltips

* update tables layout

* review fixes

* fix spelling

* update screenshots

* update screenshot
2026-02-19 15:14:32 +01:00

65 lines
1.9 KiB
TypeScript

import { Box } from '@chakra-ui/react';
import React from 'react';
import type { InterchainTransfer } from '@blockscout/interchain-indexer-types';
import type { PaginationParams } from 'ui/shared/pagination/types';
import { ACTION_BAR_HEIGHT_DESKTOP } from 'ui/shared/ActionBar';
import DataListDisplay, { type Props as DataListDisplayProps } from 'ui/shared/DataListDisplay';
import TokenTransfersCrossChainListItem from './TokenTransfersCrossChainListItem';
import TokenTransfersCrossChainTable from './TokenTransfersCrossChainTable';
import { getItemKey } from './utils';
interface Props extends Omit<DataListDisplayProps, 'children'> {
items?: Array<InterchainTransfer>;
isLoading?: boolean;
pagination?: PaginationParams;
currentAddress?: string;
tableTop?: number;
}
const TokenTransfersCrossChainContent = ({ items, isLoading, pagination, currentAddress, tableTop, ...rest }: Props) => {
const content = items ? (
<>
<Box hideFrom="lg">
{ items.map((item, index) => (
<TokenTransfersCrossChainListItem
key={ getItemKey(item, isLoading ? index : undefined) }
data={ item }
isLoading={ isLoading }
currentAddress={ currentAddress }
py={ 4 }
textStyle="sm"
rowGap="14px"
/>
)) }
</Box>
<Box hideBelow="lg">
<TokenTransfersCrossChainTable
data={ items }
isLoading={ isLoading }
top={ tableTop ?? (pagination?.isVisible ? ACTION_BAR_HEIGHT_DESKTOP : 0) }
currentAddress={ currentAddress }
/>
</Box>
</>
) : null;
return (
<DataListDisplay
itemsNum={ items?.length }
emptyText="There are no cross-chain token transfers."
emptyStateProps={{
term: 'token transfer',
}}
{ ...rest }
>
{ content }
</DataListDisplay>
);
};
export default React.memo(TokenTransfersCrossChainContent);