import { Stack } from "@mui/material"; import { Container } from "@mui/material"; import Box from '@mui/material/Box'; // import ohcimg from "../../../public/ohc.jpg"; // import group from "../../../public/Group.jpg"; import group from '../../assets/images/Group.jpg' // import RoleCard from "./RoleCard"; import chiefmedoff from "../../assets/images/ChiefMedicalOfficer.png"; import reception from "../../assets/images/Reception.png"; import applicationadmin from "../../assets/images/Application Admin.png"; import medicalExamination from "../../assets/images/Medical Examination.png"; import employee from "../../assets/images/Employee.jpg"; import pharmacy from "../../assets/images/Pharmacy.png"; import useAxiosPrivate from "../../utils/useAxiosPrivate"; import { useNavigate } from "react-router-dom"; import { useEffect, useState } from "react"; import { useSessionStorage } from "../../utils/useSessionStorage"; import { Card, CardActionArea, CardMedia, Typography } from "@mui/material"; import logo from '../../assets/images/Ohctech-logo-white.png' const OhcSelection = () => { // const [icons] = useState([ // { image: medicalExamination, name: "OHC dwarka" }, // { image: reception, name: "OHC ..." }, // { image: applicationadmin, name: "OHC ..." }, // { image: chiefmedoff, name: "OHC ..." }, // { image: employee, name: "OHC ..." }, // { image: pharmacy, name: "OHC ..." }, // ]); // from old starting const axiosClientPrivate = useAxiosPrivate(); const [ohc, setOhc] = useState([]); // const [hoveredCard, setHoveredCard] = useState(null); // State to track hovered card const { sessionData,updateSessionData } = useSessionStorage("sessionData"); const user = sessionData?.userId; const navigate = useNavigate(); useEffect(() => { const controller = new AbortController(); const getOhc = async () => { try { const response = await axiosClientPrivate.get(`/users/ohcs/${user}`, { signal: controller.signal, }); console.log(response.data); setOhc(response.data); } catch (err) { setOhc([]); } }; getOhc(); return () => { controller.abort(); }; }, [axiosClientPrivate, user]); const handleOhcClick = (id) => { if (id === null || id === "" || id === undefined) { return; } updateSessionData({ ohcId: id }); navigate("/roleSelection"); }; // Ending // const RoleImage = { // AA: applicationadmin, // ME: medicalExamination, // REC : reception, // CMO: chiefmedoff, // EMP : employee, // PHY : pharmacy // }; const OhcImage = { AA: applicationadmin, ME: medicalExamination, REC : reception, CMO: chiefmedoff, EMP : employee, PHY : pharmacy }; return ( {/* Logo */} Logo Nice to see you again WELCOME BACK
OHCTECH is a venture conceptualized by Occupational Health Experts and developed by Techsyneric Technologies professionals who wanted to develop Occupational health solutions
{ohc.map((item,index) => (
handleOhcClick(item.id)} > {item.ohcName}
))}
); }; export default OhcSelection;