import React from 'react' import { useSelector } from 'react-redux' import { Link } from 'react-router-dom' import { Achievement } from '../Achievement/Achievement' import { LEVELS, SKILLS } from '../constants/constants' import maleBig from '../../images/medium_male_big.png' import './candidateSidebar.scss' import { Highlighter } from '../../App' import { useState } from 'react' import { useEffect } from 'react' import { selectUserInfo } from '../../redux/outstaffingSlice' import { isRejected } from '@reduxjs/toolkit' const getYearsString = (years) => { let yearsString if (years % 10 === 1) { yearsString = 'год' } else if (years === 11 || years === 12 || years === 13 || years === 14) { yearsString = 'лет' } else if (years % 10 === 2 || years % 10 === 3 || years % 10 === 4) { yearsString = 'года' } else { yearsString = 'лет' } return `${years} ${yearsString}` } <<<<<<< HEAD const CandidateSidebar = ({ candidate, position, setActiveSnippet, activeSnippet }) => { const showSnippet = () => { setActiveSnippet((prev)=>!prev) } ======= const CandidateSidebar = ({ candidate, position }) => { const userId = localStorage.getItem('id') >>>>>>> documents return (

{candidate.specification} {SKILLS[candidate.position_id]},{' '} {LEVELS[candidate.level]}{' '}

{candidate && candidate.years_of_exp && ( <>

Опыт работы

{getYearsString(candidate.years_of_exp)}

)} {userId && candidate.id === userId && ( <<<<<<< HEAD {/* */} {/* */}
{candidate && candidate.achievements && candidate.achievements.map((item) => { return ======= )}
{candidate && candidate.achievements && candidate.achievements.map((item, index) => { return >>>>>>> documents })}
) } export default CandidateSidebar