import { Navigate } from 'react-router-dom';
import useAuth from '../Auth/useAuth';
import React from 'react'

export const PrivateRoute= (props) => {
    console.log(props)
    let auth = useAuth();
    const isAuthenticated = auth.isLogged();

    if (isAuthenticated) {
        return children
    }

    return <Navigate to="/" />
}
