text: import React from 'react'
  import { Redirect, Route } from 'react-router-dom'
  
  function PrivateRoute({ children, ...rest }) {
    const fakeAuth = {
      isAuthenticated: true,
      authenticate(cb) {
        this.isAuthenticated = true
        setTimeout(cb, 100)
      },
      singout(cb) {
        this.isAuthenticated = false
        setTimeout(cb, 100)
      },
    }
    return (
      <Route
        {...rest}
        render={() => {
          return fakeAuth.isAuthenticated === true ? (
            children
          ) : (
            <Redirect to="/login" />
          )
        }}
      />
    )
  }
  
  export default PrivateRoute
  