var h = require('hyperscript') const TITLE = 'double - transactions' const Nav = require('../components/nav') function transactionsView (state, emit) { const entries = h('div.pb6', [ h('table', [ h('thead', h('tr', [ h('td.pr2', 'account'), h('td.pr2', 'debit'), h('td.pr2', 'credit'), h('td.pr2', 'description') ])), h('tbody', state.entries.map(entry => ['debit', 'credit'].map(i => { return i === 'debit' ? h('tr.bg-light-gray', [ h('td', entry.msg.debit), h('td', entry.msg.amount), h('td', ''), h('td', entry.msg.description) ]) : h('tr', [ h('td', entry.msg.credit), h('td', ''), h('td.bg-washed-red', entry.msg.amount), h('td', entry.msg.description) ]) }))) ]) ]) return h('body.code.ph3.lh-copy', [ state.cache(Nav, 'nav').render(), entries ]) } module.exports = transactionsView