1616 */
1717
1818import { useTranslation } from 'react-i18next' ;
19- import { ITransaction } from '../../api/account' ;
19+ import { TTransactions } from '../../api/account' ;
2020import A from '../../components/anchor/anchor' ;
2121import { runningInAndroid } from '../../utils/env' ;
2222import { Transaction } from './transaction' ;
@@ -25,7 +25,7 @@ import style from './transactions.module.css';
2525type TProps = {
2626 accountCode : string ;
2727 explorerURL : string ;
28- transactions ?: ITransaction [ ] ;
28+ transactions ?: TTransactions ;
2929 handleExport : ( ) => void ;
3030} ;
3131
@@ -62,8 +62,8 @@ export const Transactions = ({
6262 < div className = { style . currency } > { t ( 'transaction.details.amount' ) } </ div >
6363 < div className = { style . action } > </ div >
6464 </ div >
65- { ( transactions && transactions . length > 0 )
66- ? transactions . map ( ( props , index ) => (
65+ { ( transactions && transactions . success && transactions . list . length > 0 )
66+ ? transactions . list . map ( ( props , index ) => (
6767 < Transaction
6868 accountCode = { accountCode }
6969 key = { props . internalID }
@@ -72,7 +72,11 @@ export const Transactions = ({
7272 { ...props } />
7373 ) ) : (
7474 < div className = { `flex flex-row flex-center ${ style . empty } ` } >
75- < p > { t ( 'transactions.placeholder' ) } </ p >
75+ { transactions && ! transactions . success ? (
76+ < p > { t ( 'transactions.errorLoadTransactions' ) } </ p >
77+ ) : (
78+ < p > { t ( 'transactions.placeholder' ) } </ p >
79+ ) }
7680 </ div >
7781 ) }
7882 </ div >
0 commit comments