import { Flex, Box } 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 { TableCell, TableRow } from 'toolkit/chakra/table'; 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 ChainIcon from 'ui/shared/externalChains/ChainIcon'; 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 TokenTransferTableItem = ({ token, total, transaction_hash: txHash, from, to, baseAddress, showTxInfo, type, timestamp, enableTimeIncrement, isLoading, chainData, }: Props) => { return ( { showTxInfo && ( { txHash ? ( ) : (
) } ) } { chainData && ( ) } { token ? ( <> { getTokenTypeName(token.type, chainData?.app_config) } { getTokenTransferTypeText(type) } ) : 'N/A' } { total && 'token_id' in total && total.token_id !== null && token && ( ) } { showTxInfo && ( { txHash ? ( ) : ( - ) } ) } { token && isConfidentialTokenType(token.type) && (!total || !('value' in total) || total.value === null) ? ( ) : ( ) } ); }; export default React.memo(TokenTransferTableItem);