import {Navigate, Outlet} from "react-router-dom";
import {useAuth} from "../Hooks/AuthContext.jsx";

const PrivateRoute = () => {
    const {user} = useAuth();

    if (!user) {
        return <Navigate to="/login"/>;
    }

    return <Outlet/>;
};


export default PrivateRoute;