/**
 * @name umi 的路由配置
 * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
 * @param path  path 只支持两种占位符配置，第一种是动态参数 :id 的形式，第二种是 * 通配符，通配符只能出现路由字符串的最后。
 * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径，也可以是相对路径，如果是相对路径，会从 src/pages 开始找起。
 * @param routes 配置子路由，通常在需要为多个路径增加 layout 组件时使用。
 * @param redirect 配置路由跳转
 * @param wrappers 配置路由组件的包装组件，通过包装组件可以为当前的路由组件组合进更多的功能。 比如，可以用于路由级别的权限校验
 * @param name 配置路由的标题，默认读取国际化文件 menu.ts 中 menu.xxxx 的值，如配置 name 为 login，则读取 menu.ts 中 menu.login 的取值作为标题
 * @param icon 配置路由的图标，取值参考 https://ant.design/components/icon-cn
 * @doc https://umijs.org/docs/guides/routes
 */
export default [
  {
    path: '/user',
    layout: false,
    routes: [
      {
        path: '/user/login',
        layout: false,
        name: 'login',
        component: './user/login',
      },
      {
        path: '/user/register',
        layout: false,
        name: 'register',
        component: './user/register',
      },
      {
        path: '/user/register-result',
        layout: false,
        name: 'register-result',
        component: './user/register-result',
      },
      {
        path: '/user/forgot-password',
        layout: false,
        name: 'forgot-password',
        component: './user/forgot-password',
      },
      {
        path: '/user',
        redirect: '/user/login',
      },
      {
        component: '404',
        path: '/user/*',
      },
    ],
  },
  {
    name: 'vault',
    icon: 'wallet',
    path: '/vault',
    routes: [
      {
        path: '/vault',
        redirect: '/vault/trade',
      },
      {
        name: 'trade',
        icon: 'transaction',
        path: '/vault/trade',
        component: './Vault/Trade/index.new',
      },
      {
        name: 'usdc',
        icon: 'dollar',
        path: '/vault/usdc',
        component: './Vault/USDC/index.new',
      },
    ],
  },
  {
    name: 'lending',
    icon: 'bank',
    path: '/lending',
    routes: [
      {
        path: '/lending',
        redirect: '/lending/user',
      },
      {
        name: 'user',
        icon: 'setting',
        path: '/lending/user',
        component: './Lending/User/index.complete',
      },
    ],
  },
  {
    name: 'lp',
    icon: 'stock',
    path: '/lp',
    routes: [
      {
        path: '/lp',
        redirect: '/lp/pool',
      },
      {
        name: 'pool',
        icon: 'database',
        path: '/lp/pool',
        component: './LP/index.full',
      },
    ],
  },
  {
    name: 'statistics',
    icon: 'bar-chart',
    path: '/statistics',
    routes: [
      {
        path: '/statistics',
        redirect: '/statistics/holders',
      },
      {
        name: 'holders',
        icon: 'team',
        path: '/statistics/holders',
        component: './Statistics/Holders/index',
      },
    ],
  },
  {
    name: 'admin',
    icon: 'setting',
    path: '/admin',
    access: 'canAdmin',
    routes: [
      {
        path: '/admin',
        redirect: '/admin/factory',
      },
      {
        name: 'factory',
        icon: 'build',
        path: '/admin/factory',
        component: './Admin/Factory/index.new',
        access: 'canAdmin',
      },
      {
        name: 'assets',
        icon: 'fund',
        path: '/admin/assets',
        component: './Admin/Assets/index',
        access: 'canAdmin',
      },
      {
        name: 'asset-custody',
        icon: 'lock',
        path: '/admin/asset-custody',
        component: './Admin/AssetCustody/index',
        access: 'canAdmin',
      },
      {
        name: 'asset-audit-reports',
        icon: 'audit',
        path: '/admin/asset-audit-reports',
        component: './Admin/AssetAuditReports/index',
        access: 'canAdmin',
      },
      {
        name: 'product-links',
        icon: 'link',
        path: '/admin/product-links',
        component: './Admin/ProductLinks/index',
        access: 'canAdmin',
      },
      {
        name: 'points-rules',
        icon: 'trophy',
        path: '/admin/points-rules',
        component: './Admin/PointsRules/index',
        access: 'canAdmin',
      },
      {
        name: 'seasons',
        icon: 'calendar',
        path: '/admin/seasons',
        component: './Admin/Seasons/index',
        access: 'canAdmin',
      },
      {
        name: 'vip-tiers',
        icon: 'crown',
        path: '/admin/vip-tiers',
        component: './Admin/VIPTiers/index',
        access: 'canAdmin',
      },
      {
        name: 'users',
        icon: 'team',
        path: '/admin/users',
        component: './Admin/Users/index',
        access: 'canAdmin',
      },
      {
        name: 'invite-codes',
        icon: 'gift',
        path: '/admin/invite-codes',
        component: './Admin/InviteCodes/index',
        access: 'canAdmin',
      },
      {
        name: 'system-contracts',
        icon: 'code',
        path: '/admin/system-contracts',
        component: './Admin/SystemContracts/index',
        access: 'canAdmin',
      },
      {
        name: 'liquidation',
        icon: 'thunderbolt',
        path: '/admin/liquidation',
        component: './Admin/Liquidation/index',
        access: 'canAdmin',
      },
    ],
  },
  {
    name: 'account',
    icon: 'user',
    path: '/account',
    routes: [
      {
        path: '/account',
        redirect: '/account/settings',
      },
      {
        name: 'settings',
        icon: 'setting',
        path: '/account/settings',
        component: './account/settings',
      },
    ],
  },
  {
    path: '/',
    redirect: '/vault/trade',
  },
  {
    component: '404',
    path: '/*',
  },
];
