aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/components/TransactionItem.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/components/TransactionItem.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/components/TransactionItem.tsx29
1 files changed, 16 insertions, 13 deletions
diff --git a/packages/taler-wallet-webextension/src/components/TransactionItem.tsx b/packages/taler-wallet-webextension/src/components/TransactionItem.tsx
index 9af768641..eda190110 100644
--- a/packages/taler-wallet-webextension/src/components/TransactionItem.tsx
+++ b/packages/taler-wallet-webextension/src/components/TransactionItem.tsx
@@ -22,7 +22,7 @@ import {
Transaction,
TransactionType,
WithdrawalType,
- ExtendedStatus,
+ TransactionMajorState,
} from "@gnu-taler/taler-util";
import { h, VNode } from "preact";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
@@ -42,6 +42,9 @@ import { Time } from "./Time.js";
export function TransactionItem(props: { tx: Transaction }): VNode {
const tx = props.tx;
const { i18n } = useTranslationContext();
+ /**
+ *
+ */
switch (tx.type) {
case TransactionType.Withdrawal:
return (
@@ -53,7 +56,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
iconPath={"W"}
pending={
- tx.extendedStatus === ExtendedStatus.Pending
+ tx.txState.major === TransactionMajorState.Pending
? tx.withdrawalDetails.type ===
WithdrawalType.TalerBankIntegrationApi
? !tx.withdrawalDetails.confirmed
@@ -77,7 +80,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
iconPath={"P"}
pending={
- tx.extendedStatus === ExtendedStatus.Pending
+ tx.txState.major === TransactionMajorState.Pending
? i18n.str`Payment in progress`
: undefined
}
@@ -89,12 +92,12 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
id={tx.transactionId}
amount={tx.amountEffective}
debitCreditIndicator={"credit"}
- subtitle={tx.info.summary}
- title={tx.info.merchant.name}
+ subtitle={"tx.info.summary"} //FIXME: DD37 wallet-core is not returning this value
+ title={"tx.info.merchant.name"} //FIXME: DD37 wallet-core is not returning this value
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
iconPath={"R"}
pending={
- tx.extendedStatus === ExtendedStatus.Pending
+ tx.txState.major === TransactionMajorState.Pending
? i18n.str`Executing refund...`
: undefined
}
@@ -110,7 +113,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
iconPath={"T"}
pending={
- tx.extendedStatus === ExtendedStatus.Pending
+ tx.txState.major === TransactionMajorState.Pending
? i18n.str`Grabbing the tipping...`
: undefined
}
@@ -126,7 +129,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
iconPath={"R"}
pending={
- tx.extendedStatus === ExtendedStatus.Pending
+ tx.txState.major === TransactionMajorState.Pending
? i18n.str`Refreshing coins...`
: undefined
}
@@ -142,7 +145,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
iconPath={"D"}
pending={
- tx.extendedStatus === ExtendedStatus.Pending
+ tx.txState.major === TransactionMajorState.Pending
? i18n.str`Deposit in progress`
: undefined
}
@@ -158,7 +161,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
iconPath={"I"}
pending={
- tx.extendedStatus === ExtendedStatus.Pending
+ tx.txState.major === TransactionMajorState.Pending
? i18n.str`Waiting to be paid`
: undefined
}
@@ -174,7 +177,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
iconPath={"I"}
pending={
- tx.extendedStatus === ExtendedStatus.Pending
+ tx.txState.major === TransactionMajorState.Pending
? i18n.str`Payment in progress`
: undefined
}
@@ -190,7 +193,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
iconPath={"T"}
pending={
- tx.extendedStatus === ExtendedStatus.Pending
+ tx.txState.major === TransactionMajorState.Pending
? i18n.str`Receiving the transfer`
: undefined
}
@@ -206,7 +209,7 @@ export function TransactionItem(props: { tx: Transaction }): VNode {
timestamp={AbsoluteTime.fromTimestamp(tx.timestamp)}
iconPath={"T"}
pending={
- tx.extendedStatus === ExtendedStatus.Pending
+ tx.txState.major === TransactionMajorState.Pending
? i18n.str`Waiting to be received`
: undefined
}