text: import React from 'react';
  import { Route, Redirect } from 'react-router-dom';
  import { connect } from 'react-redux';
  
  const PrivateRoute = ({ auth, component: Component, ...rest }) => (
    <Route
      {...rest}
      render={props =>
        auth.googleUser || auth.localUser ? (
          <Component {...props} />
        ) : (
          <Redirect
            to={{
              pathname: '/login',
              state: { from: props.location },
            }}
          />
        )
      }
    />
  );
  
  export default connect(
    state => ({
      auth: state.authReducer,
    }),
    {},
  )(PrivateRoute);
  