import React, { useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { Link, Navigate, useNavigate, useParams } from "react-router-dom"; import { currentCandidate, selectCurrentCandidate } from "@redux/outstaffingSlice"; import { LEVELS, SKILLS } from "@utils/constants"; import { createMarkup } from "@utils/helper"; import { apiRequest } from "@api/request"; import Sidebar from "@components/CandidateSidebar/CandidateSidebar"; import { Footer } from "@components/Common/Footer/Footer"; import { Navigation } from "@components/Navigation/Navigation"; import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs"; import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader"; import SkillSection from "@components/SkillSection/SkillSection"; import rightArrow from "assets/icons/arrows/arrowRight.svg"; import gitImgItem from "assets/icons/gitItemImg.svg"; import back from "assets/images/partnerProfile/back-end.webp"; import design from "assets/images/partnerProfile/design.webp"; import front from "assets/images/partnerProfile/front-end.webp"; import rectangle from "assets/images/rectangle_secondPage.png"; import "./candidate.scss"; const Candidate = () => { if (localStorage.getItem("role_status") !== "18") { return ; } // const { id: candidateId } = useParams(); const navigate = useNavigate(); const dispatch = useDispatch(); const currentCandidateObj = useSelector(selectCurrentCandidate); const [activeSnippet, setActiveSnippet] = useState(true); useEffect(() => { window.scrollTo(0, 0); }, []); useEffect(() => { apiRequest(`/user/me`, {}).then((el) => dispatch(currentCandidate(el.userCard)) ); }, [dispatch]); const { position_id, skillValues, vc_text: text } = currentCandidateObj; const setStyles = () => { const styles = { classes: "", header: "", img: "" }; switch (Number(position_id)) { case 1: { styles.classes = "back"; styles.header = "Backend"; styles.img = back; break; } case 2: { styles.classes = "des"; styles.header = "Frontend"; styles.img = front; break; } case 3: { styles.classes = "front"; styles.header = "Design"; styles.img = design; break; } default: break; } return styles; }; const { header, img, classes } = setStyles(); return (

{currentCandidateObj.specification}  {" "} {SKILLS[currentCandidateObj.position_id]}  {" "} {LEVELS[currentCandidateObj.level]}

navigate("/profile/catalog")} >
К списку кандидатов

{header}

{activeSnippet ? (

# Описание опыта

{text ? (
) : (

{currentCandidateObj.vc_text ? currentCandidateObj.vc_text : "Описание отсутствует..."}

)}
) : (

Портфолио разработчика

img
cybershop-api

Реактивная социальная сеть

arrow
JavaScript
img
cybershop-api

Реактивная социальная сеть

arrow
JavaScript
img
cybershop-api

Реактивная социальная сеть

arrow
JavaScript
)}
); }; export default Candidate;