// Copyright 2020 Blue Static // This program is free software licensed under the GNU General Public License, // version 3.0. The full text of the license can be found in LICENSE.txt. // SPDX-License-Identifier: GPL-3.0-only import { createMemo } from 'solid-js'; import { For } from 'solid-js/dom'; import { TaxReturn, Form } from 'ustaxlib/core'; const S = require('./FormView.css'); interface FormProps { tr: TaxReturn; form: Form; } export default function FormView(props: FormProps) { const lines = createMemo(() => { const keys = Object.keys(props.form.lines); keys.sort((a, b) => a.localeCompare(b, undefined, { numeric: true })); return keys.map(k => props.form.lines[k]); }); return ( <>

Form {props.form.name}

{line => }
); } function Line(props: { tr, line }) { const { tr, line } = props; const value = createMemo(() => { try { return JSON.stringify(line.value(tr)); } catch (e) { return {e.message}; } }); return ( {line.id} {line.description} {value()} ); }