/** ========================================================= * Material Dashboard 2 PRO React TS - v1.0.0 ========================================================= * Product Page: https://www.creative-tim.com/product/material-dashboard-2-pro-react-ts * Copyright 2022 Creative Tim (https://www.creative-tim.com) Coded by www.creative-tim.com ========================================================= * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. */ // @mui material components import Grid from "@mui/material/Grid"; // Material Dashboard 2 PRO React TS components import MDBox from "components/MDBox"; import MDTypography from "components/MDTypography"; // NewUser page components import FormField from "layouts/pages/users/new-user/components/FormField"; import { QFrontendStepMetaData } from "@kingsrook/qqq-frontend-core/lib/model/metaData/QFrontendStepMetaData"; interface Props { formLabel?: string; formData: any; primaryKeyId?: string; } function QDynamicForm(props: Props): JSX.Element { const { formData, formLabel, primaryKeyId } = props; const { formFields, values, errors, touched, } = formData; /* const { firstName: firstNameV, lastName: lastNameV, company: companyV, email: emailV, password: passwordV, repeatPassword: repeatPasswordV, } = values; */ return ( {formLabel} {/* TODO - help text Mandatory information */} {formFields && Object.keys(formFields).length > 0 && Object.keys(formFields).map((fieldName: any) => { const field = formFields[fieldName]; if (primaryKeyId && fieldName === primaryKeyId) { return null; } if (values[fieldName] === undefined) { values[fieldName] = ""; } return ( ); })} {/* 0 && !errors.firstName} /> 0 && !errors.lastName} /> 0 && !errors.email} /> 0 && !errors.password} inputProps={{ autoComplete: "" }} /> 0 && !errors.repeatPassword} inputProps={{ autoComplete: "" }} /> */} ); } QDynamicForm.defaultProps = { formLabel: undefined, primaryKeyId: undefined, }; export default QDynamicForm;