import { Flex } from '@chakra-ui/react'; import React from 'react'; import type { TokenTransfer } from 'types/api/tokenTransfer'; import type { ClusterChainConfig } from 'types/multichain'; import { getTokenTypeName, isConfidentialTokenType } from 'lib/token/tokenTypes'; import { Badge } from 'toolkit/chakra/badge'; import { Skeleton } from 'toolkit/chakra/skeleton'; import AddressFromTo from 'ui/shared/address/AddressFromTo'; import NftEntity from 'ui/shared/entities/nft/NftEntity'; import TokenEntity from 'ui/shared/entities/token/TokenEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity'; import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile'; import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip'; import { getTokenTransferTypeText } from 'ui/shared/TokenTransfer/helpers'; import AssetValue from 'ui/shared/value/AssetValue'; import ConfidentialValue from 'ui/shared/value/ConfidentialValue'; import TxAdditionalInfo from 'ui/txs/TxAdditionalInfo'; type Props = TokenTransfer & { baseAddress?: string; showTxInfo?: boolean; enableTimeIncrement?: boolean; isLoading?: boolean; chainData?: ClusterChainConfig; }; const TokenTransferListItem = ({ token, total, transaction_hash: txHash, from, to, baseAddress, showTxInfo, type, timestamp, enableTimeIncrement, isLoading, chainData, }: Props) => { return ( { token && ( <> { getTokenTypeName(token.type, chainData?.app_config) } ) } { getTokenTransferTypeText(type) } { showTxInfo && txHash && ( ) } { total && 'token_id' in total && total.token_id !== null && token && ( ) } { showTxInfo && ( { txHash && ( ) } ) } { total && 'value' in total && total.value !== null && ( Value ) } { token && isConfidentialTokenType(token.type) && (!total || !('value' in total) || total.value === null) && ( Value ) } ); }; export default React.memo(TokenTransferListItem);