import { Route } from 'react-router'
import { IProps } from './ProtectedRoute'

export const PublicRoute = ({
  component: Component,
  layout: Layout,
  showSidebar,
  isExperienceFlow,
  className,
  ...rest
}: IProps) => (
  <Route
    {...rest}
    render={props => (
      <Layout
        showSidebar={showSidebar}
        isExperienceFlow={isExperienceFlow}
        className={className}
      >
        <Component {...props} />
      </Layout>
    )}
  />
)
