ohctechv3/.svn/pristine/f5/f531ecd0f2a8df2a4a9da37a200e3259c983d16d.svn-base
2024-10-28 15:03:36 +05:30

68 lines
2.0 KiB
Plaintext

import Ohclogo from "./Ohclogo";
import { FormControl, Grid} from "@mui/material";
import PropTypes from "prop-types";
import Input from "../common/Input";
import { InputLabel, MenuItem, Select } from "@mui/material";
const PlantForm = ({
values,
touched,
handleBlur,
errors,
handleChange,
setFieldValue,
handleSubmit,
}) => {
PlantForm.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,
};
// const Medselect = ["Active", "Not Active"];
// const isDefault = ["Yes", "No"];
return (
<div style={{ display: "flex", justifyContent: "center" }}>
<form onSubmit={handleSubmit}>
<Grid container spacing={2} justifyContent="center" alignItems="center" sx={{width:400}} >
<Grid item xs={12} justifyContent="center" alignItems="center">
<FormControl fullWidth>
<Grid container spacing={2} justifyContent="center" alignItems="center">
<Grid item xs={12} container spacing={1} justifyContent="center" alignItems="center">
<Input
label="Plant Name"
name="plantName"
type="text"
size="large"
value={values.plantName}
onChange={handleChange}
onBlur={handleBlur}
helperText={
errors.plantName && touched.plantName? (
<span style={{ color: "red" }}>{errors.plantName}</span>
) : null
}
/>
</Grid>
</Grid>
</FormControl>
</Grid>
</Grid>
</form>
</div>
);
};
export default PlantForm;