import React from "react"; import { BusyMessage } from "component/common"; import LinkTransaction from "component/linkTransaction"; class TransactionList extends React.PureComponent { componentWillMount() { this.props.fetchTransactions(); } render() { const { fetchingTransactions, transactionItems } = this.props; const rows = []; if (transactionItems.length > 0) { transactionItems.forEach(function(item) { rows.push( {(item.amount > 0 ? "+" : "") + item.amount} {item.date ? item.date.toLocaleDateString() : {__("(Transaction pending)")}} {item.date ? item.date.toLocaleTimeString() : {__("(Transaction pending)")}} ); }); } return (

{__("Transaction History")}

{fetchingTransactions && } {!fetchingTransactions && rows.length === 0 ?
{__("You have no transactions.")}
: ""} {rows.length > 0 ? {rows}
{__("Amount")} {__("Date")} {__("Time")} {__("Transaction")}
: ""}
); } } export default TransactionList;