import "./JobAdDetails.css" import {useEffect, useState} from "react"; import {useDispatch, useSelector} from "react-redux"; import {JobAdvertisementActions} from "../../redux/actions/jobAdvertisementActions"; import {useParams} from "react-router"; import Roles from "../../enumerations/Roles"; import JobType from "../../enumerations/JobType"; import EmploymentStatus from "../../enumerations/EmploymentStatus"; import {formatRelativeTime} from "../../utils/utils"; import {AddJobAdModal} from "./AddJobAdModal"; import {ApplyToJobAdModal} from "../applications/ApplyToJobAdModal"; export const JobAdDetails = () => { const dispatch = useDispatch(); const [jobAd, setJobAd] = useState("") const [recruiterDetails, setRecruiterDetails] = useState(""); const [role, setRole] = useState("") const {id} = useParams(); const auth = useSelector(state => state.auth.currentUser); useEffect(() => { setRole(auth.role) }, [auth]) useEffect(() => { JobAdvertisementActions.fetchJobAdvertisementById(id, (success, response) => { if (success) { setJobAd(response.data) JobAdvertisementActions.fetchRecruiterDetailsById(response.data.recruiterId, (successAgain, responseAgain) => { if(successAgain) { setRecruiterDetails(responseAgain.data) } }) } }); }, []) return (

{jobAd.title}

{jobAd.jobType===JobType.JOB ? "Job" : "Internship"} {!jobAd.active && Expired}

{jobAd.recruiterName}{jobAd.industry}{formatRelativeTime(jobAd.postedOn)}

Hourly rate: ${jobAd.startingSalary}

Employment status: {jobAd.employmentStatus==="FULL_TIME" ? "Full-time" : "Part-time"}

Active until: {new Date(jobAd.activeUntil).toLocaleString('default', { day: 'numeric', month: 'long', year: 'numeric' })}

About the job

{jobAd.description && (

") }}>

)}

{jobAd.recruiterName}

{/*TO DO - AFTER IMPLEMENTING FORM FOR UPDATING PERSONAL INFO*/}

About the company

For over two decades, we have been harnessing technology to drive meaningful change. Working side by side with leading brands, we build strategies, products and solutions tailored to unique needs –regardless of industry, region or scale. By combining world-class engineering, industry expertise and a people-centric mindset, we consult and partner with our customers to create technological solutions that drive innovation and transform businesses.

From ideation to production, we support our customers with bespoke solutions across various industries, including payments, insurance, finance and banking, technology, media and entertainment, telecommunications, retail and consumer goods, supply chain and logistics, healthcare and life sciences, energy and resources, government, automotive and travel.

{recruiterDetails.email} {recruiterDetails.phoneNumber}

) }