import { FormControl, Grid } from "@mui/material"; import PropTypes from "prop-types"; import Input from "../common/Input"; import SingleSelect from "../common/SingleSelect"; import InputAdornment from '@mui/material/InputAdornment'; // const FoodNutrients = [ // { // name: "carbohydrate", // // value: "Carbohydrate", // label: "Enter the name of nutrient", // }, // { // name: "protein", // // value: "Protein", // label: "Enter the name of nutrient", // }, // { // name: "protein", // // value: "Protein", // label: "Enter the name of nutrient", // }, // { // name: "protein", // // value: "Protein", // label: "Enter the name of nutrient", // }, // { // name: "protein", // // value: "Protein", // label: "Enter the name of nutrient", // }, // { // name: "protein", // // value: "Protein", // label: "Enter the name of nutrient", // }, // { // name: "protein", // // value: "Protein", // label: "Enter the name of nutrient", // }, // { // name: "protein", // // value: "Protein", // label: "Enter the name of nutrient", // }, // ]; const FoodNutritionMappingForm = ({ // FoodNutrients, nutrient, foodname, values, unitpair, touched, handleBlur, errors, handleChange, handleSubmit, setFieldValue, }) => { FoodNutritionMappingForm.propTypes = { values: PropTypes.object.isRequired, touched: PropTypes.object.isRequired, errors: PropTypes.object.isRequired, handleBlur: PropTypes.func.isRequired, handleChange: PropTypes.func.isRequired, setFieldValue: PropTypes.func.isRequired, handleSubmit: PropTypes.func.isRequired, }; console.log("nnnnnnnnnnnnnnn",unitpair) return (
{/* */} {/* {errors.foodId} ) : null } />*/} { // const syntheticEvent = { // target: { // name: "foodMaster", // value: newValue, // }, // }; // handleChange(syntheticEvent); // }} // handleChange ={handleChange} onChange={(event, newValue) => { setFieldValue('foodMaster', newValue ? newValue.label : ''); }} onBlur={handleBlur} type="text" helperText={ errors.foodMaster && touched.foodMaster ? ( {errors.foodMaster} ) : null } /> {nutrient.map((item, index) => ( {errors[item.label]} ) : null } InputProps={{ endAdornment: {unitpair[item.value]}, }} /> ))} {/* */}
); }; export default FoodNutritionMappingForm;