// @flow import React from 'react'; import Button from 'component/button'; import moment from 'moment'; type Props = { accountDetails: any, transactions: any, }; const WalletFiatAccountHistory = (props: Props) => { // receive transactions from parent component const { transactions } = props; let accountTransactions = transactions; // TODO: should add pagination here // if there are more than 10 transactions, limit it to 10 for the frontend // if (accountTransactions && accountTransactions.length > 10) { // accountTransactions.length = 10; // } function getSymbol(transaction) { if (transaction.currency === 'eur') { return '€'; } else { return '$'; } } function getCurrencyIso(transaction) { if (transaction.currency === 'eur') { return 'EUR'; } else { return 'USD'; } } return (
{accountTransactions && accountTransactions.map((transaction) => ( ))}
{__('Date')} {<>{__('Receiving Channel Name')}} {__('Tip Location')} {__('Amount')} {__('Processing Fee')} {__('Odysee Fee')} {__('Received Amount')}
{moment(transaction.created_at).format('LLL')} {getSymbol(transaction)} {transaction.tipped_amount / 100} {getCurrencyIso(transaction)} {getSymbol(transaction)} {transaction.transaction_fee / 100} {getSymbol(transaction)} {transaction.application_fee / 100} {getSymbol(transaction)} {transaction.received_amount / 100}
{!accountTransactions &&

{__('No Transactions')}

}
); }; export default WalletFiatAccountHistory;