import React, { useState, useEffect } from 'react'; import { BrowserRouter as Router, Switch, Route, Link, useParams } from 'react-router-dom'; import './light.css'; import { Container, Divider, Dropdown, Form, Grid, Header, Icon, Image, Menu, Message, Segment, Table } from 'semantic-ui-react'; import { BasicTable, requester } from './utils.js'; import { NotFound, PleaseLogin } from './Misc.js'; export function Transactions(props) { const { user } = props; return (
Transactions
Date Amount Account Memo {user.transactions.length ? user.transactions.slice().reverse().map((x, i) => {x.date} ${x.amount} {x.account_type} {x.memo} ) : None }
); }; export function TransactionDetail(props) { const { user } = props; const { id } = useParams(); const t = user.transactions.find(x => x.id == id); return ( t ?
Transaction Receipt
Date: {t.date} ID: {t.id} Amount: ${t.amount} Category: {t.category} Account: {t.account} Info Source: {t.info_source} Reference: {t.reference_number} Memo: {t.memo}
: ); };