// @flow import React from 'react'; import Button from 'component/button'; import moment from 'moment'; type Props = { accountDetails: any, transactions: any, }; const WalletBalance = (props: Props) => { // receive transactions from parent component const { transactions } = props; let accountTransactions; // reverse so most recent payments come first if (transactions && transactions.length) { accountTransactions = transactions.reverse(); } // 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 (
{__('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} |
{__('No Transactions')}
}