aboutsummaryrefslogtreecommitdiff
path: root/packages/exchange-backoffice-ui/src/pages/ShowForm.tsx
blob: 5440ab7e1ad937d24451befbb4279bc69e38a458 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { h } from "preact";
import { allForms } from "../Dashboard.js";
import { NiceForm } from "../NiceForm.js";

export function ShowForm({ number }: { number?: string }) {
  const selectedForm = Number.parseInt(number ?? "0", 10);
  if (Number.isNaN(selectedForm)) {
    return <div>WHAT! {number}</div>;
  }
  const showingFrom = allForms[selectedForm].impl;
  const storedValue = {
    fullName: "loggedIn_user_fullname",
    when: {
      t_ms: new Date().getTime(),
    },
  };
  return (
    <NiceForm initial={storedValue} form={showingFrom} onUpdate={() => {}} />
  );
}