diff --git a/src/components/dashboard/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx index 50976f5..79ccc03 100644 --- a/src/components/dashboard/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx @@ -15,7 +15,7 @@ const vehicle_amount = { "مینی بوس": 2000, }; -const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog, vehicle_type }) => { +const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog, vehicle_type, row }) => { const t = useTranslations(); const [expertImg, setExpertImg] = useState(""); const [expertFileType, setExpertFileType] = useState(null); @@ -69,17 +69,17 @@ const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog, vehicle_type }) = const formik = useFormik({ initialValues: { - description: "", - approved_amount: "", - facility_bank: "", - facility_gov: "", - facility_person: "", - physical_progress: "", - repayment_period: "", - committed_employment: "", - sakht_period: "", - tanafos_period: "", - existing_employment: "", + description: row.original.description || "", + approved_amount: row.original.approved_amount / 1000000 || "", + facility_bank: row.original.facility_bank / 1000000 || "", + facility_gov: row.original.facility_gov / 1000000 || "", + facility_person: row.original.facility_person / 1000000 || "", + physical_progress: row.original.physical_progress || "", + repayment_period: row.original.repayment_period || "", + committed_employment: row.original.committed_employment || "", + sakht_period: row.original.sakht_period || "", + tanafos_period: row.original.tanafos_period || "", + existing_employment: row.original.existing_employment || "", expert_img: null, }, validationSchema, diff --git a/src/components/dashboard/passenger-boss/Form/ConfirmForm/index.jsx b/src/components/dashboard/passenger-boss/Form/ConfirmForm/index.jsx index 055ea70..104922c 100644 --- a/src/components/dashboard/passenger-boss/Form/ConfirmForm/index.jsx +++ b/src/components/dashboard/passenger-boss/Form/ConfirmForm/index.jsx @@ -4,7 +4,7 @@ import {useEffect, useState} from "react"; import ConfirmContent from "./ConfirmContent"; import CallMadeIcon from '@mui/icons-material/CallMade'; -const Confirm = ({rowId, mutate, vehicle_type}) => { +const Confirm = ({rowId, mutate, vehicle_type, row}) => { const t = useTranslations(); const [openConfirmDialog, setOpenConfirmDialog] = useState(false); const [dialogSize, setDialogSize] = useState('sm'); @@ -35,7 +35,7 @@ const Confirm = ({rowId, mutate, vehicle_type}) => { PaperProps={{sx: {transition: 'all .3s' , boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}} maxWidth={dialogSize}> {t("PassengerBoss.confirm")} + vehicle_type={vehicle_type} row={row}/> ) diff --git a/src/components/dashboard/passenger-boss/TableRowActions.jsx b/src/components/dashboard/passenger-boss/TableRowActions.jsx index 6a8b915..f286785 100644 --- a/src/components/dashboard/passenger-boss/TableRowActions.jsx +++ b/src/components/dashboard/passenger-boss/TableRowActions.jsx @@ -11,6 +11,7 @@ const TableRow = ({row, mutate}) => { rowId={row.getValue("id")} vehicle_type={row.original.vehicle_type} mutate={mutate} + row={row} />