import React, { useState } from 'react' import { useDispatch, useSelector } from 'react-redux' import { useHistory, useParams, Link } from 'react-router-dom' import { currentCandidate, selectCurrentCandidate, auth } from '../redux/outstaffingSlice' import SVG from 'react-inlinesvg' import { WithLogout } from '../hoc/withLogout' import Form from '../components/Form/Form' import { LEVELS, SKILLS } from '../components/constants/constants' import { fetchGet } from '../server/server' import { Footer } from '../components/Footer/Footer' import arrow from '../images/right-arrow.png' import rectangle from '../images/rectangle_secondPage.png' import telegramIcon from '../images/telegram-icon.svg' import './formPage.scss' import { getRole } from '../redux/roleSlice' const goBack = (history) => { history.goBack() } const FormPage = () => { const params = useParams() const history = useHistory() const dispatch = useDispatch() const candidate = useSelector(selectCurrentCandidate) const role = useSelector(getRole) if (!candidate.id) { fetchGet({ link: `${process.env.REACT_APP_API_URL}/api/profile/`, params: Number(params.id), history, role, logout: () => dispatch(auth(false)) }).then((el) => dispatch(currentCandidate(el))) } return (
goBack(history)}>
Вернуться к кандидату
{candidate.specification} {SKILLS[candidate.position_id]},{' '} {LEVELS[candidate.level]}
Выбранный кандидат
или
Заявка на собеседование через телеграм
) } export default FormPage