import React from 'react' import {Link} from 'react-router-dom' import {Achievement} from '../Achievement/Achievement' import {LEVELS, SKILLS} from '../../constants/constants' import './candidateSidebar.scss' import {urlForLocal} from "../../helper"; 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}` }; const CandidateSidebar = ({candidate, setActiveSnippet, activeSnippet}) => { const userId = localStorage.getItem('id'); const showSnippet = () => { setActiveSnippet((prev) => !prev) }; return (

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

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

Опыт работы

{getYearsString(candidate.years_of_exp)}

)} {userId && ( <>
{candidate && candidate.achievements && candidate.achievements.map((item) => { return })}
)}
) }; export default CandidateSidebar