import React from "react"; import { Route, Redirect } from "react-router-dom"; export const PrivateRoute = ({ component: Component, protectedRoute, ...rest }) => ( { if (protectedRoute) { const user = localStorage.getItem("user"); if (!user) { return ; } return ; } return ; }} /> );