Files
explore/ui/shared/value/TokenValueInterchain.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

55 lines
1.5 KiB
TypeScript

import type { BoxProps } from '@chakra-ui/react';
import React from 'react';
import type { TokenInfo } from '@blockscout/interchain-indexer-types';
import type { ExternalChain } from 'types/externalChains';
import type { EntityProps as TokenEntityProps } from 'ui/shared/entities/token/TokenEntity';
import TokenEntityInterchain from 'ui/shared/entities/token/TokenEntityInterchain';
import type { Props as AssetValueProps } from './AssetValue';
import AssetValue from './AssetValue';
interface Props extends Omit<AssetValueProps, 'asset'> {
token: TokenInfo;
chain: ExternalChain | undefined;
tokenEntityProps?: Omit<TokenEntityProps, 'token'> & BoxProps;
}
const TokenValueInterchain = ({ token, tokenEntityProps, chain, ...rest }: Props) => {
const tokenInfo = React.useMemo(() => {
return {
symbol: token.symbol ?? null,
address_hash: token.address_hash,
icon_url: token.icon_url ?? null,
name: token.name ?? null,
type: 'ERC-20',
reputation: null,
};
}, [ token.address_hash, token.icon_url, token.name, token.symbol ]);
const asset = (
<TokenEntityInterchain
token={ tokenInfo }
chain={ chain }
noCopy
onlySymbol
flexShrink={ 0 }
w="fit-content"
ml={ 2 }
icon={{ marginRight: 1 }}
{ ...tokenEntityProps }
/>
);
return (
<AssetValue
asset={ asset }
decimals={ token.decimals }
{ ...rest }
/>
);
};
export default React.memo(TokenValueInterchain);