import { FC, PropsWithChildren } from 'react' import { useLocation, Navigate } from 'react-router-dom'; import { useAppSelector } from '../../hooks/redux'; const OnlyUnauthorized: FC = ({children}) => { const {isAuth} = useAppSelector(state => state.UserSlice); const location = useLocation(); if (isAuth) { return ; } return children; } export default OnlyUnauthorized;