mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* basic components and address page refactoring * second part of refactoring * third part of refactoring * NativeCoinValue component * more refactoring * rename TruncatedValue into TruncatedText * minor fixes * refactor block details * fix layout of value and fee in tx table * update screenshots * different units for tooltip and stats widget small value fix * update screenshots * update tx table screenshot * fix copy button vertical alignment
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
|
|
import type { ArbitrumL2TxnWithdrawalsItem } from 'types/api/arbitrumL2';
|
|
import type { TokenInfo } from 'types/api/token';
|
|
|
|
import { Skeleton } from 'toolkit/chakra/skeleton';
|
|
import NativeCoinValue from 'ui/shared/value/NativeCoinValue';
|
|
import TokenValue from 'ui/shared/value/TokenValue';
|
|
|
|
interface Props {
|
|
data: ArbitrumL2TxnWithdrawalsItem;
|
|
loading?: boolean;
|
|
}
|
|
|
|
const ArbitrumL2TxnWithdrawalsValue = ({ data, loading }: Props) => {
|
|
|
|
if (data.token) {
|
|
const token: TokenInfo | null = {
|
|
...data.token,
|
|
decimals: String(data.token.decimals),
|
|
type: 'ERC-20',
|
|
holders_count: null,
|
|
exchange_rate: null,
|
|
total_supply: null,
|
|
circulating_market_cap: null,
|
|
icon_url: null,
|
|
reputation: null,
|
|
};
|
|
|
|
return (
|
|
<TokenValue
|
|
amount={ data.token.amount ?? '0' }
|
|
token={ token }
|
|
layer="L1"
|
|
tokenEntityProps={{ noIcon: true }}
|
|
loading={ loading }
|
|
/>
|
|
);
|
|
}
|
|
|
|
if (data.callvalue && data.callvalue !== '0') {
|
|
return (
|
|
<NativeCoinValue
|
|
amount={ data.callvalue }
|
|
loading={ loading }
|
|
/>
|
|
);
|
|
}
|
|
|
|
return <Skeleton loading={ loading }><span>-</span></Skeleton>;
|
|
};
|
|
|
|
export default React.memo(ArbitrumL2TxnWithdrawalsValue);
|