Files
nobat724_front/components/dashboard/userAccount/tabs/detailUser/index.js
T
2024-10-22 01:38:38 +03:30

54 lines
1.7 KiB
JavaScript

import { useState } from "react";
import Form from "./Form";
import { Button } from "@mui/material";
import ArrowLeftWhiteD from "@/components/icons/ArrowLeftWhiteD";
function DetailUser({ user }) {
const [data, setData] = useState({
phone: { value: user.phone, isEdit: true },
national_code: { value: user.national_code, isEdit: true },
name: { value: user.name, isEdit: true },
date_of_birth: { value: user.date_of_birth, isEdit: true },
father_name: { value: user.father_name, isEdit: true },
insurance_number: { value: user.insurance_number, isEdit: true },
home_phone: { value: user.home_phone, isEdit: true },
work_phone: { value: user.work_phone, isEdit: true },
});
const [selected, setSelected] = useState({
gender: "",
blood_group: "",
insurance: "",
marital_status: "",
education: "",
job: "",
});
const changeData = (value, type, name) =>
setData({
...data,
[name]: {
...data[name],
[type]: value,
},
});
const updateSelect = (event, name) =>
setSelected({ ...selected, [name]: event });
return (
<div className="opacity-page">
<Form data={data} changeData={changeData} updateSelect={updateSelect} />
<Button
className="!gap-[4px] !mr-auto !text-nowrap !flex !flex-nowrap !py-[8px]
!bg-[#5559CE] !rounded-[4px] !text-[#EFEFEF] !text-[14px] md:!text-[16px] !font-medium
!mt-[32px] sm:!mt-[38px] md:!mt-[43px] lg:!mt-[48px] !px-[16px] sm:!px-[19px] md:!px-[22px] lg:!px-[24px]"
>
ثبت اطلاعات
<ArrowLeftWhiteD />
</Button>
</div>
);
}
export default DetailUser;