import { Box, Button, Divider, Heading, Spinner } from "@chakra-ui/react"; import React from "react"; import FormField from "./FormField"; import { OPACITY_ON_LOAD } from "../Layout/animations"; import { ArrowBackIcon } from "@chakra-ui/icons"; const FormInputMain = ({ register, groupedFields, control, errors, onSubmit, children, onCancle, submitTitle, p, w, btnLoading, btnhidden, }) => { return ( {Object.entries(groupedFields).map(([section, fields], index) => ( {/* */} {section} {fields.map( ( { label, name, id, arabic, type, isRequired, selectedImageData, setSelectedImageData, imageData, handleImageChange, removeImage, placeHolder, options, helperText, multiple, width, value, handleInputChange }, key ) => ( ) )} {index < Object.entries(groupedFields).length - 1 && } ))} {children} {onCancle && ( )} {btnhidden ? ( "" ) : ( )} ); }; export default FormInputMain;