aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/components/Cashouts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-02-10 09:51:37 -0300
committerSebastian <sebasjm@gmail.com>2023-02-10 09:52:02 -0300
commitba8b40c9150586982e42e76d364d76202627bd6f (patch)
treeebeed7551aad62a03954945de72320b6c1bc1f01 /packages/demobank-ui/src/components/Cashouts
parent53af8b486fd8a538c1f54a2ce66ed5f74b2b46ed (diff)
downloadwallet-core-ba8b40c9150586982e42e76d364d76202627bd6f.tar.xz
business account
Diffstat (limited to 'packages/demobank-ui/src/components/Cashouts')
-rw-r--r--packages/demobank-ui/src/components/Cashouts/index.ts2
-rw-r--r--packages/demobank-ui/src/components/Cashouts/state.ts17
-rw-r--r--packages/demobank-ui/src/components/Cashouts/stories.tsx18
-rw-r--r--packages/demobank-ui/src/components/Cashouts/views.tsx5
4 files changed, 12 insertions, 30 deletions
diff --git a/packages/demobank-ui/src/components/Cashouts/index.ts b/packages/demobank-ui/src/components/Cashouts/index.ts
index db39ba7e4..1410267be 100644
--- a/packages/demobank-ui/src/components/Cashouts/index.ts
+++ b/packages/demobank-ui/src/components/Cashouts/index.ts
@@ -23,7 +23,7 @@ import { useComponentState } from "./state.js";
import { LoadingUriView, ReadyView } from "./views.js";
export interface Props {
- account: string;
+ empty?: boolean;
}
export type State = State.Loading | State.LoadingUriError | State.Ready;
diff --git a/packages/demobank-ui/src/components/Cashouts/state.ts b/packages/demobank-ui/src/components/Cashouts/state.ts
index 7e420940f..178a1e815 100644
--- a/packages/demobank-ui/src/components/Cashouts/state.ts
+++ b/packages/demobank-ui/src/components/Cashouts/state.ts
@@ -18,27 +18,24 @@ import { AbsoluteTime, Amounts } from "@gnu-taler/taler-util";
import { useCashouts } from "../../hooks/circuit.js";
import { Props, State, Transaction } from "./index.js";
-export function useComponentState({
- account,
-}: Props): State {
- const result = useCashouts()
+export function useComponentState({ empty }: Props): State {
+ const result = useCashouts();
if (result.loading) {
return {
status: "loading",
- error: undefined
- }
+ error: undefined,
+ };
}
if (!result.ok) {
return {
status: "loading-error",
- error: result
- }
+ error: result,
+ };
}
-
return {
status: "ready",
error: undefined,
- cashout: result.data,
+ cashouts: result.data,
};
}
diff --git a/packages/demobank-ui/src/components/Cashouts/stories.tsx b/packages/demobank-ui/src/components/Cashouts/stories.tsx
index 77fdde092..05439780c 100644
--- a/packages/demobank-ui/src/components/Cashouts/stories.tsx
+++ b/packages/demobank-ui/src/components/Cashouts/stories.tsx
@@ -26,20 +26,4 @@ export default {
title: "transaction list",
};
-export const Ready = tests.createExample(ReadyView, {
- transactions: [
- {
- amount: {
- currency: "USD",
- fraction: 0,
- value: 1,
- },
- counterpart: "ASD",
- negative: false,
- subject: "Some",
- when: {
- t_ms: new Date().getTime(),
- },
- },
- ],
-});
+export const Ready = tests.createExample(ReadyView, {});
diff --git a/packages/demobank-ui/src/components/Cashouts/views.tsx b/packages/demobank-ui/src/components/Cashouts/views.tsx
index 30803d4d1..16ae8a58f 100644
--- a/packages/demobank-ui/src/components/Cashouts/views.tsx
+++ b/packages/demobank-ui/src/components/Cashouts/views.tsx
@@ -39,7 +39,7 @@ export function ReadyView({ cashouts }: State.Ready): VNode {
<tr>
<th>{i18n.str`Created`}</th>
<th>{i18n.str`Confirmed`}</th>
- <th>{i18n.str`Counterpart`}</th>
+ <th>{i18n.str`Status`}</th>
<th>{i18n.str`Subject`}</th>
</tr>
</thead>
@@ -53,8 +53,9 @@ export function ReadyView({ cashouts }: State.Ready): VNode {
? format(item.confirmation_time, "dd/MM/yyyy HH:mm:ss")
: "-"}
</td>
+ <td>{Amounts.stringifyValue(item.amount_debit)}</td>
<td>{Amounts.stringifyValue(item.amount_credit)}</td>
- <td>{item.counterpart}</td>
+ <td>{item.status}</td>
<td>{item.subject}</td>
</tr>
);