text: import {React} from "react";
  import { Redirect, Route } from "react-router-dom";
  
  function ProtectedRoute({ component: Component, ...restOfProps }) {
    const isAuthenticated = localStorage.getItem("isAuthenticated");
    console.log("this", isAuthenticated);
  // This might be a cool way of doign Protected routes
    return (
      <Route
        {...restOfProps}
        render={(props) =>
          isAuthenticated ? <Component {...props} /> : <Redirect to="/LoginPage" />
        }
      />
    );
  }
  
  export default ProtectedRoute;
  