diff --git a/src/components/dashboard/machinary-office/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/machinary-office/Form/ConfirmForm/ConfirmContent.jsx index 438def6..05ad51b 100644 --- a/src/components/dashboard/machinary-office/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/machinary-office/Form/ConfirmForm/ConfirmContent.jsx @@ -7,7 +7,6 @@ import { DialogContent, FormHelperText, Grid, - InputAdornment, LinearProgress, Stack, TextField, @@ -21,6 +20,7 @@ import PriceField from "@/core/components/PriceField"; import * as Yup from "yup"; import CustomAccordion from "@/core/components/CustomAccordion"; import ImageContent from "@/core/components/ImageContent"; +import SelectBox from "@/core/components/SelectBox"; const vehicle_amount = { "اتوبوس": 7000, @@ -232,51 +232,93 @@ const ConfirmContent = ({mutate, setOpenConfirmDialog, rowId, vehicle_type, hand /> - {t("ConfirmDialog.sakht_period_day")}, + selectType="sakht_period" + selectors={[ + { + id: 1, + value: "30", + name: "1 ماه - 30 روز" + }, + { + id: 2, + value: "60", + name: "2 ماه - 60 روز" + }, + { + id: 3, + value: "90", + name: "3 ماه - 90 روز" + }, + { + id: 4, + value: "120", + name: "4 ماه - 120 روز" + }, + { + id: 5, + value: "150", + name: "5 ماه - 150 روز" + }, + { + id: 6, + value: "180", + name: "6 ماه - 180 روز" + } + ]} + schema={{value: 'value', name: 'name'}} + select={formik.values.sakht_period} + handleChange={(event) => { + formik.setFieldValue('sakht_period', event.target.value) }} + setFieldTouched={formik.setFieldTouched} + error={formik.touched.sakht_period && Boolean(formik.errors.sakht_period)} + helperText={formik.touched.sakht_period && formik.errors.sakht_period} + onBlur={formik.handleBlur("sakht_period")} /> - {t("ConfirmDialog.tanafos_period_month")}, + selectType="tanafos_period" + selectors={[ + { + id: 1, + value: "1", + name: "1 ماه" + }, + { + id: 2, + value: "2", + name: "2 ماه" + }, + { + id: 3, + value: "3", + name: "3 ماه" + }, + { + id: 4, + value: "4", + name: "4 ماه" + } + ]} + schema={{value: 'value', name: 'name'}} + select={formik.values.tanafos_period} + handleChange={(event) => { + formik.setFieldValue('tanafos_period', event.target.value) }} + setFieldTouched={formik.setFieldTouched} + error={formik.touched.tanafos_period && Boolean(formik.errors.tanafos_period)} + helperText={formik.touched.tanafos_period && formik.errors.tanafos_period} + onBlur={formik.handleBlur("tanafos_period")} /> diff --git a/src/core/components/SelectBox.jsx b/src/core/components/SelectBox.jsx new file mode 100644 index 0000000..6fc787c --- /dev/null +++ b/src/core/components/SelectBox.jsx @@ -0,0 +1,58 @@ +import {FormControl, FormHelperText, InputLabel, MenuItem, Select,} from "@mui/material"; +import {useTranslations} from "next-intl"; + +function SelectBox({ + select, + name, + selectors, + label, + handleChange, + error, + onBlur, + schema, + disabled, + helperText, + isLoading, + errorEcured, + variant = "outlined" + }) { + const t = useTranslations(); + + return ( + + {label} + + {helperText} + + ); +} + +export default SelectBox;