From 64e3705669e7c12b8013704654f17cf8eaf659d4 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 25 May 2023 18:08:20 -0300 Subject: cases, account details and new-form screen --- .../src/pages/NewFormEntry.tsx | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 packages/exchange-backoffice-ui/src/pages/NewFormEntry.tsx (limited to 'packages/exchange-backoffice-ui/src/pages/NewFormEntry.tsx') diff --git a/packages/exchange-backoffice-ui/src/pages/NewFormEntry.tsx b/packages/exchange-backoffice-ui/src/pages/NewFormEntry.tsx new file mode 100644 index 000000000..9c143addd --- /dev/null +++ b/packages/exchange-backoffice-ui/src/pages/NewFormEntry.tsx @@ -0,0 +1,78 @@ +import { VNode, h } from "preact"; +import { allForms } from "./AntiMoneyLaunderingForm.js"; +import { Pages } from "../pages.js"; +import { NiceForm } from "../NiceForm.js"; +import { AmlState } from "../types.js"; +import { Amounts } from "@gnu-taler/taler-util"; + +export function NewFormEntry({ + account, + type, +}: { + account?: string; + type?: string; +}): VNode { + if (!account) { + return
no account
; + } + if (!type) { + return ; + } + + const selectedForm = Number.parseInt(type ?? "0", 10); + if (Number.isNaN(selectedForm)) { + return
WHAT! {type}
; + } + const showingFrom = allForms[selectedForm].impl; + const initial = { + fullName: "loggedIn_user_fullname", + when: { + t_ms: new Date().getTime(), + }, + state: AmlState.pending, + threshold: Amounts.parseOrThrow("USD:10"), + }; + return ( + { + alert(JSON.stringify(v)); + }} + > +
+ + Cancel + + +
+
+ ); +} + +function SelectForm({ account }: { account: string }) { + return ( +
+
New form for account: {account}
+ {allForms.map((form, idx) => { + return ( + + {form.name} + + ); + })} +
+ ); +} -- cgit v1.2.3