From c680f5aa71b08e978444df07f93c381f9d47ab82 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 5 Jun 2023 10:04:09 -0300 Subject: rename aml --- packages/aml-backoffice-ui/src/NiceForm.tsx | 59 +++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 packages/aml-backoffice-ui/src/NiceForm.tsx (limited to 'packages/aml-backoffice-ui/src/NiceForm.tsx') diff --git a/packages/aml-backoffice-ui/src/NiceForm.tsx b/packages/aml-backoffice-ui/src/NiceForm.tsx new file mode 100644 index 000000000..4fc0ea89f --- /dev/null +++ b/packages/aml-backoffice-ui/src/NiceForm.tsx @@ -0,0 +1,59 @@ +import { useTranslationContext } from "@gnu-taler/web-util/browser"; +import { ComponentChildren, Fragment, h } from "preact"; +import { FlexibleForm } from "./forms/index.js"; +import { FormProvider } from "./handlers/FormProvider.js"; +import { RenderAllFieldsByUiConfig } from "./handlers/forms.js"; + +export function NiceForm({ + initial, + onUpdate, + form, + onSubmit, + children, +}: { + children?: ComponentChildren; + initial: Partial; + onSubmit?: (v: Partial) => void; + form: FlexibleForm; + onUpdate?: (d: Partial) => void; +}) { + return ( + +
+ {form.design.map((section, i) => { + if (!section) return ; + return ( +
+
+

+ {section.title} +

+ {section.description && ( +

+ {section.description} +

+ )} +
+
+
+
+ +
+
+
+
+ ); + })} +
+ {children} +
+ ); +} -- cgit v1.2.3