From c680f5aa71b08e978444df07f93c381f9d47ab82 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 5 Jun 2023 10:04:09 -0300 Subject: rename aml --- .../aml-backoffice-ui/src/pages/NewFormEntry.tsx | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 packages/aml-backoffice-ui/src/pages/NewFormEntry.tsx (limited to 'packages/aml-backoffice-ui/src/pages/NewFormEntry.tsx') diff --git a/packages/aml-backoffice-ui/src/pages/NewFormEntry.tsx b/packages/aml-backoffice-ui/src/pages/NewFormEntry.tsx new file mode 100644 index 000000000..fdb255701 --- /dev/null +++ b/packages/aml-backoffice-ui/src/pages/NewFormEntry.tsx @@ -0,0 +1,76 @@ +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 { AbsoluteTime, 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: AbsoluteTime.now(), + 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