diff --git a/src/Components/FormInputMain.jsx b/src/Components/FormInputMain.jsx index ee67c64..2edef3d 100644 --- a/src/Components/FormInputMain.jsx +++ b/src/Components/FormInputMain.jsx @@ -5,28 +5,29 @@ import { OPACITY_ON_LOAD } from "../Layout/animations"; import { ArrowBackIcon } from "@chakra-ui/icons"; const FormInputMain = ({ + register, groupedFields, control, errors, onSubmit, children, - onCancle, + onCancle, submitTitle, p, - w + w, }) => { return (
{Object.entries(groupedFields).map(([section, fields], index) => ( - - + + {/* */} {section} ( @@ -83,22 +84,24 @@ const FormInputMain = ({ ))} {children} - - - - {onCancle && } + + + + {onCancle && ( + + )} + + + + + + + ); +}; + +export default EditIO; diff --git a/src/Pages/IO_Management/EditIO/EditIOForm.jsx b/src/Pages/IO_Management/EditIO/EditIOForm.jsx new file mode 100644 index 0000000..52e0bfd --- /dev/null +++ b/src/Pages/IO_Management/EditIO/EditIOForm.jsx @@ -0,0 +1,68 @@ +import React, { useContext } from "react"; +import { + Box, + Input, + Select, + Textarea, + FormControl, + FormLabel, + FormErrorMessage, +} from "@chakra-ui/react"; +import GlobalStateContext from "../../../Contexts/GlobalStateContext"; +import { useParams } from "react-router-dom"; + +const FormField = ({ field, register, errors }) => { + const { label, name, type, placeHolder, options, width } = field; + + + return ( + + + {label} + {type === "text" && ( + + )} + {type === "textarea" && ( +