import React from "react"; import { Navigate } from "react-router-dom"; import { getToken } from "utils/tokenService"; const ProtectedRoute = ({ children }) => { console.log(`token for checking whether authenticated: ${getToken()}`); const isAuthenticated = getToken() !== null; // Check if user is authenticated return isAuthenticated ? children : ; }; export default ProtectedRoute;