import React from 'react'
import { PrivateRoute,AsyncComponent } from '@/hoc'

let Login = AsyncComponent(()=>{return import('@/page/Login')})
let UserInformation = AsyncComponent(()=>{return import('@/page/user/information')})
let UserPreview = AsyncComponent(()=>{return import('@/page/user/preview')})

let routes = [
  {
    path: '/',
    exact: true,
    render: props => <PrivateRoute path="/" component={UserInformation} {...props}/>
  },
  {
    path: '/login',
    title: '用户登录',
    render: props => <Login {...props}/>
  },
  {
    path: '/user/information',
    title: '用户信息录入',
    render: props => (
      <PrivateRoute path="/user/information" component={UserInformation} {...props}/>
    )
  },
  {
    path: '/user/preview/:id',
    title: '简历预览',
    render: props => <UserPreview {...props}/>
  }
]

export default routes
