Files: 8f610eca2bb7c82ab4520dcd17f0816be4901f3b / views / transactions.js
990 bytesRaw
1 | var h = require('hyperscript') |
2 | const TITLE = 'double - transactions' |
3 | const Nav = require('../components/nav') |
4 | |
5 | function transactionsView (state, emit) { |
6 | const entries = h('div.pb6', [ |
7 | h('table', [ |
8 | h('thead', h('tr', [ |
9 | h('td.pr2', 'account'), |
10 | h('td.pr2', 'debit'), |
11 | h('td.pr2', 'credit'), |
12 | h('td.pr2', 'description') |
13 | ])), |
14 | h('tbody', state.entries.map(entry => ['debit', 'credit'].map(i => { |
15 | return i === 'debit' |
16 | ? h('tr', [ |
17 | h('td', entry.msg.debit), |
18 | h('td', entry.msg.amount), |
19 | h('td', '-'), |
20 | h('td', entry.msg.description) |
21 | ]) |
22 | : h('tr', [ |
23 | h('td', entry.msg.credit), |
24 | h('td', '-'), |
25 | h('td', entry.msg.amount), |
26 | h('td', entry.msg.description) |
27 | ]) |
28 | }))) |
29 | ]) |
30 | ]) |
31 | |
32 | return h('body.code.ph3.lh-copy', [ |
33 | state.cache(Nav, 'nav').render(), |
34 | entries |
35 | ]) |
36 | } |
37 | |
38 | module.exports = transactionsView |
39 |
Built with git-ssb-web