import React from 'react' import { View } from 'react-native' import { useLanguage } from 'ordering-components/native' import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder'; import { useTheme } from 'styled-components/native' import { OText } from '../shared'; import { WalletTransactionItem } from '../WalletTransactionItem' import { NotFoundSource } from '../NotFoundSource'; import { Container, TransactionsWrapper } from './styles' export const WalletTransactions = (props: any) => { const { transactionsList, currentWalletSelected } = props const theme = useTheme() const [, t] = useLanguage() return ( {!transactionsList?.loading && !transactionsList?.error && transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length > 0 && ( <> {t('TRANSACTIONS_HISTORY', 'Transactions history')} {transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.map((transaction: any, i: number) =>( ))} )} {(transactionsList?.loading || !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) && ( {[...Array(4).keys()].map(i => ( ))} )} {!transactionsList?.loading && !(transactionsList?.loading && transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]) && (transactionsList?.error || !transactionsList.list?.[`wallet:${currentWalletSelected?.id}`]?.length) && ( {transactionsList?.error ? t('ERROR_NOT_FOUND_TRANSACTIONS', 'Sorry, an error has occurred') : t('NOT_FOUND_TRANSACTIONS', 'No transactions to show at this time.') } )} ) }