import useSWR from "swr"; import { Field, reduxForm } from "redux-form"; export function Textfield(props) { const { name, label } = props; return (
); } export function MultiLinefield(props) { const { name, label } = props; return (

Do not include personal or financial information, like your National Insurance number or credit card details.
); } export function DateField(props) { const { name, label } = props; return (
); } export function YesNofield(props) { const { name, label } = props; const yesNo = ["Yes", "No"]; return (
{Object.keys(yesNo).map((key, index) => (
))}
); } const RenderPickList = ({ datafieldname, name, label, input, meta: { touched, error }, }) => { const fetcher = (url) => fetch(url).then((res) => res.json()); const { data, errorStr } = useSWR("/api/lookups/" + datafieldname, fetcher); if (errorStr) return (
); if (!data) return (
{label} loading...
); console.log(JSON.stringify(data.GlobalOptionSet.Options)); const dropdownObj = data.GlobalOptionSet.Options; return (
{touched && error && {error}}
); }; export function PickList(props) { const { name, label, datafieldname } = props; return (
); } export function NumericField(props) { const { name, label } = props; return (
); } export function DecimalField(props) { const { name, label } = props; return (
); } export function ReadOnlyfield(props) { const { name, label } = props; return (
); }