diff --git a/src/pages/employee/EmployeeProfile.jsx b/src/pages/employee/EmployeeProfile.jsx index 4de20675..a4ad6aba 100644 --- a/src/pages/employee/EmployeeProfile.jsx +++ b/src/pages/employee/EmployeeProfile.jsx @@ -17,6 +17,8 @@ import { useNavigate } from "react-router-dom"; import Avatar from "../../components/common/Avatar"; import AttendancesEmployeeRecords from "./AttendancesEmployeeRecords"; import ManageEmployee from "../../components/Employee/ManageEmployee"; +import { useChangePassword } from "../../components/Context/ChangePasswordContext"; + const EmployeeProfile = () => { const projectID = useSelector((store) => store.localVariables.projectId); const { employeeId } = useParams(); @@ -27,17 +29,17 @@ const EmployeeProfile = () => { const tab = SearchParams.get("for"); const [activePill, setActivePill] = useState(tab); const [currentEmployee, setCurrentEmployee] = useState(); - const [showModal, setShowModal] = useState(false); + const [showModal, setShowModal] = useState(false); const handlePillClick = (pillKey) => { setActivePill(pillKey); }; - const closeModal = () => { - setShowModal(false); - fetchEmployeeProfile(employeeId); - }; - const handleShow = () => setShowModal(true); + const closeModal = () => { + setShowModal(false); + fetchEmployeeProfile(employeeId); + }; + const handleShow = () => setShowModal(true); const fetchEmployeeProfile = async (employeeID) => { try { @@ -95,177 +97,184 @@ const EmployeeProfile = () => { if (loading) { return
{`${currentEmployee?.firstName} ${currentEmployee?.lastName}`}
+{`${currentEmployee?.firstName} ${currentEmployee?.lastName}`}
+Email: | -- {currentEmployee?.email || NA} - | -
- Phone Number: - | -- {currentEmployee?.phoneNumber || NA} - | -
- Emergency Contact Person: - | -- {currentEmployee?.emergencyContactPerson || ( - NA - )} - | -
- Emergency Contact Number: - | -- {currentEmployee?.emergencyPhoneNumber || ( - NA - )} - | -
Email: | ++ {currentEmployee?.email || NA} + | +
+ Phone Number: + | ++ {currentEmployee?.phoneNumber || NA} + | +
+ Emergency Contact Person: + | ++ {currentEmployee?.emergencyContactPerson || ( + NA + )} + | +
+ Emergency Contact Number: + | ++ {currentEmployee?.emergencyPhoneNumber || ( + NA + )} + | +
Gender: | ++ {currentEmployee?.gender || NA} + | +
+ Birth Date: + | ++ {currentEmployee?.birthDate ? ( + new Date( + currentEmployee.birthDate + ).toLocaleDateString() + ) : ( + NA + )} + | +
+ Joining Date: + | ++ {currentEmployee?.joiningDate ? ( + new Date( + currentEmployee.joiningDate + ).toLocaleDateString() + ) : ( + NA + )} + | +
+ Job Role: + | ++ {currentEmployee?.jobRole || NA} + | +
Address: | ++ {currentEmployee?.currentAddress || NA} + | +