diff options
author | Sebastian <sebasjm@gmail.com> | 2022-08-31 00:20:35 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-08-31 00:20:35 -0300 |
commit | d84424202dca22fff22cb1d304286f627642187b (patch) | |
tree | 39b69521a1e5a84c71b7752d355423705941bdd7 /packages/taler-wallet-webextension/src/components | |
parent | 7dc66c2441c4b77cfed0c4add592d4b7d5912ec3 (diff) | |
download | wallet-core-d84424202dca22fff22cb1d304286f627642187b.tar.xz |
p2p tx rendering
Diffstat (limited to 'packages/taler-wallet-webextension/src/components')
-rw-r--r-- | packages/taler-wallet-webextension/src/components/TransactionItem.tsx | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/packages/taler-wallet-webextension/src/components/TransactionItem.tsx b/packages/taler-wallet-webextension/src/components/TransactionItem.tsx index 8033b3ee3..6dcee6eca 100644 --- a/packages/taler-wallet-webextension/src/components/TransactionItem.tsx +++ b/packages/taler-wallet-webextension/src/components/TransactionItem.tsx @@ -113,8 +113,58 @@ export function TransactionItem(props: { tx: Transaction }): VNode { pending={tx.pending} /> ); - default: - throw Error("unsupported transaction type"); + case TransactionType.PeerPullCredit: + return ( + <TransactionLayout + id={tx.transactionId} + amount={tx.amountEffective} + debitCreditIndicator={"credit"} + title={"Invoice credit"} + timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)} + iconPath={"I"} + pending={tx.pending} + /> + ); + case TransactionType.PeerPullDebit: + return ( + <TransactionLayout + id={tx.transactionId} + amount={tx.amountEffective} + debitCreditIndicator={"debit"} + title={"Invoice debit"} + timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)} + iconPath={"I"} + pending={tx.pending} + /> + ); + case TransactionType.PeerPushCredit: + return ( + <TransactionLayout + id={tx.transactionId} + amount={tx.amountEffective} + debitCreditIndicator={"credit"} + title={"Transfer credit"} + timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)} + iconPath={"T"} + pending={tx.pending} + /> + ); + case TransactionType.PeerPushDebit: + return ( + <TransactionLayout + id={tx.transactionId} + amount={tx.amountEffective} + debitCreditIndicator={"debit"} + title={"Transfer debit"} + timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)} + iconPath={"T"} + pending={tx.pending} + /> + ); + default: { + const pe: never = tx; + throw Error(`unsupported transaction type ${pe}`); + } } } |