import { Route, Redirect } from "react-router-dom";

export const ProtectedComponent:React.FC<any> = ({component:Component, ...props}) => {
  console.log(props)
    return (
        <Route>
        {() => (props.connected ? <Component {...props} /> : <Redirect to="/" />)}
      </Route>
      )
}