@@ -10,13 +10,14 @@ import { Container, PageContent } from '@/ui'
1010import TokenTransferTable from '@/components/erc20Token/tokenTransferTable'
1111import TokenTable from '@/components/pvmAccount/tokenTable'
1212import { env } from 'next-runtime-env'
13+ import { LoadingSpinner , LoadingText } from '@/components/loading'
1314
1415export default function Page ( ) {
1516 const router = useRouter ( )
16- const { metadata, token, isLoading } = useData ( )
17+ const { metadata, token } = useData ( )
1718 const id = router . query . id as string
1819 const NEXT_PUBLIC_API_HOST = env ( 'NEXT_PUBLIC_API_HOST' ) || ''
19- const { data } = usePVMAccounts ( NEXT_PUBLIC_API_HOST , {
20+ const { data, isLoading } = usePVMAccounts ( NEXT_PUBLIC_API_HOST , {
2021 address : id ,
2122 row : 10 ,
2223 page : 0 ,
@@ -29,53 +30,61 @@ export default function Page() {
2930 < PageContent >
3031 < Container >
3132 < div className = "flex flex-col gap-4" >
32- { accountData && (
33- < >
34- < div className = "" > Account #{ accountData . evm_account } </ div >
35- < Card >
36- < CardBody >
37- < div className = "flex items-center" >
38- < div className = "w-48" > Balance</ div >
39- < div >
40- { getBalanceAmount ( new BigNumber ( accountData . balance ) , token ?. decimals ) . toFormat ( ) } { token ?. symbol }
33+ { isLoading ? (
34+ < LoadingSpinner />
35+ ) : (
36+ accountData && (
37+ < >
38+ < div className = "flex flex-col lg:flex-row gap-1" >
39+ < div className = "text-base" > Account</ div >
40+ < div className = "text-sm break-all sm:text-base" > #{ accountData . evm_account } </ div >
41+ </ div >
42+ < Card >
43+ < CardBody >
44+ < div className = "flex items-center" >
45+ < div className = "w-48" > Balance</ div >
46+ < div >
47+ { getBalanceAmount ( new BigNumber ( accountData . balance ) , token ?. decimals ) . toFormat ( ) } { token ?. symbol }
48+ </ div >
4149 </ div >
42- </ div >
43- </ CardBody >
44- </ Card >
45- < Card >
46- < CardBody >
47- < Tabs aria-label = "tabs" variant = "underlined" color = { getThemeColor ( ) } >
48- < Tab key = "erc20" title = "ERC-20 Tokens" >
49- < TokenTable
50- args = { {
51- address : id ,
52- category : 'erc20' ,
53- } } > </ TokenTable >
54- </ Tab >
55- < Tab key = "erc721" title = "ERC-721 Tokens" >
56- < TokenTable
57- args = { {
58- address : id ,
59- category : 'erc721' ,
60- } } > </ TokenTable >
61- </ Tab >
62- < Tab key = "transactions" title = "Transactions" >
63- < TxTable
64- args = { {
65- address : id ,
66- } } > </ TxTable >
67- </ Tab >
68- < Tab key = "transfers" title = "Transfers" >
69- < TokenTransferTable
70- args = { {
71- address : id ,
72- } } > </ TokenTransferTable >
73- </ Tab >
74- </ Tabs >
75- </ CardBody >
76- </ Card >
77- </ >
50+ </ CardBody >
51+ </ Card >
52+ < Card >
53+ < CardBody >
54+ < Tabs aria-label = "tabs" variant = "underlined" color = { getThemeColor ( ) } >
55+ < Tab key = "erc20" title = "ERC-20 Tokens" >
56+ < TokenTable
57+ args = { {
58+ address : id ,
59+ category : 'erc20' ,
60+ } } > </ TokenTable >
61+ </ Tab >
62+ < Tab key = "erc721" title = "ERC-721 Tokens" >
63+ < TokenTable
64+ args = { {
65+ address : id ,
66+ category : 'erc721' ,
67+ } } > </ TokenTable >
68+ </ Tab >
69+ < Tab key = "transactions" title = "Transactions" >
70+ < TxTable
71+ args = { {
72+ address : id ,
73+ } } > </ TxTable >
74+ </ Tab >
75+ < Tab key = "transfers" title = "Transfers" >
76+ < TokenTransferTable
77+ args = { {
78+ address : id ,
79+ } } > </ TokenTransferTable >
80+ </ Tab >
81+ </ Tabs >
82+ </ CardBody >
83+ </ Card >
84+ </ >
85+ )
7886 ) }
87+ { ! isLoading && ! accountData && < LoadingText /> }
7988 </ div >
8089 </ Container >
8190 </ PageContent >
0 commit comments