import React, { useEffect, useState } from 'react'; import style from './Description.module.css'; import male from '../../images/medium_male.png'; import rectangle from '../../images/rectangle_secondPage.png'; import { Link } from 'react-router-dom'; import { LEVELS, SKILLS } from '../constants/constants'; import { selectProfiles, selectFilteredCandidates, selectItems } from '../../redux/outstaffingSlice'; import { useSelector } from 'react-redux'; import { fetchProfile } from '../../server/server'; const Description = ({ onLoadMore }) => { const candidatesListArr = useSelector(selectProfiles); const itemsArr = useSelector(selectItems); const filteredListArr = useSelector(selectFilteredCandidates); const [allCandidates, getAllCandidates] = useState([]); useEffect(() => { fetchProfile(`${process.env.REACT_APP_API_URL}/api/profile?limit=`, 1000).then((p) => getAllCandidates(p)); }, []); if(!filteredListArr) { return (
{ candidatesListArr.map((el) => (

{el.specification} {SKILLS[el.position_id]}, {LEVELS[el.level]}

{el.vc_text_short ? (
{el.vc_text_short}
) : (

Описание отсутствует...

)}
    {el.skillValues.map((e) => (
  • {e.skill.name}
  • ))}
))}
); } return (
{filteredListArr ? filteredListArr.map((el) => (

{el.specification} {SKILLS[el.position_id]}, {LEVELS[el.level]}

{el.vc_text_short ? (
{el.vc_text_short}
) : (

Описание отсутствует...

)}
    {el.skillValues.map((e) => (
  • {e.skill.name}
  • ))}
)) : filteredListArr.length && filteredListArr.length === 0 && <> }
{(candidatesListArr.length !== allCandidates.length && filteredListArr.length > 0) || filteredListArr===null ? ( ) : null}
); }; export default Description;