import React, {useEffect, useState} from 'react'; import {auth, getProfileInfo, setProfileInfo} from "../../redux/outstaffingSlice"; import {useDispatch, useSelector} from "react-redux"; import {Loader} from '../Loader/Loader' import {getRole} from "../../redux/roleSlice"; import {useHistory, NavLink} from "react-router-dom"; import {fetchGet} from "../../server/server"; import './profileHeader.scss' export const ProfileHeader = () => { const [isLoggingOut, setIsLoggingOut] = useState(false); const dispatch = useDispatch(); const userRole = useSelector(getRole); const profileInfo = useSelector(getProfileInfo) const history = useHistory(); useEffect(() => { fetchGet({ link: `${process.env.REACT_APP_API_URL}/api/profile/${localStorage.getItem('cardId')}`, }).then((profileInfo) => { dispatch(setProfileInfo(profileInfo)) }) }, []) return(

itguild.для разработчиков

{profileInfo.fio}

) }