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}
); }