1 import { createMemo } from 'solid-js';
2 import { For } from 'solid-js/dom';
3 import { TaxReturn, Form } from 'ustaxlib/core';
5 const S = require('./FormView.css');
12 export default function FormView(props: FormProps) {
13 const lineKeys = createMemo(() => Object.keys(props.form.lines));
17 <h2 class={S.formName}>Form {props.form.name}</h2>
19 <table class={S.table}>
20 <For each={lineKeys()}>
21 {key => <Line tr={props.tr} line={props.form.lines[key]} />}
28 function Line(props: { tr, line }) {
29 const { tr, line } = props;
30 const value = createMemo(() => {
32 return line.value(tr);
34 return <span class={S.error} title={e.stack}>{e.message}</span>;
39 <th class={S.id}>{line.id}</th>
40 <td class={S.description}>{line.description}</td>
41 <td class={S.value}>{value()}</td>