import React from "react"; import TransactionListItem from "./internal/TransactionListItem"; import FormField from "component/formField"; class TransactionList extends React.PureComponent { constructor(props) { super(props); this.state = { filter: null, }; } handleFilterChanged(event) { this.setState({ filter: event.target.value, }); } filterTransaction(transaction) { const { filter } = this.state; return !filter || filter == transaction.type; } render() { const { emptyMessage, rewards, transactions } = this.props; let transactionList = transactions.filter( this.filterTransaction.bind(this) ); return (
{(transactionList.length || this.state.filter) && {__("Filter")} {" "} } {!transactionList.length &&
{emptyMessage || __("No transactions to list.")}
} {Boolean(transactionList.length) && {transactionList.map(t => )}
{__("Date")} {__("Amount (Fee)")} {__("Type")} {__("Details")} {__("Transaction")}
}
); } } export default TransactionList;