import type { RouterConfig } from '@nuxt/schema';
// https://router.vuejs.org/api/interfaces/routeroptions.html
export default <RouterConfig>{
  routes: (_routes) => [
    {
      name: 'tokenIndex',
      path: '/',
      component: () => import('@/views/token/index.vue'),
      meta: { hasSearch: true, hasRollToken: true, footer: true },
      children: [
        {
          name: 'tokenlistDefault',
          path: '/',
          component: () => import('~/views/token/TokenList.vue'),
          meta: { hasSearch: true, hasRollToken: true, footer: true },
        },
        {
          name: 'tokenList',
          path: '/:chain?/:page(\\d+)?',
          component: () => import('~/views/token/TokenList.vue'),
          meta: { hasSearch: true, hasRollToken: true, footer: true },
        },
      ],
    },
    {
      name: 'tokenDetail',
      path: '/:chain/:tb([a-zA-Z0-9_]{10,100})',
      component: () => import('@/views/detail/index.vue'),
      meta: { hasSearch: true, hasRollToken: true, footer: false },
    },
    {
      path: '/analysis/:chain/:tb',
      name: 'tokenAnalysis',
      component: () => import('@/views/analysis/index.vue'),
      meta: { hasSearch: true, hasRollToken: true, footer: false },
    },
    {
      path: '/login/:code?',
      name: 'login',
      component: () => import('@/views/login/index.vue'),
    },
    {
      path: '/user',
      name: 'userInfo',
      component: () => import('@/views/user/index.vue'),
      meta: { hasSearch: false, hasRollToken: false, footer: false },
      children: [
        {
          path: '/user/personal',
          name: 'personal',
          component: () => import('@/views/user/PersonalCenter.vue'),
          meta: { hasSearch: false, hasRollToken: false, footer: false },
        },
        {
          path: '/user/member',
          name: 'member',
          component: () => import('@/views/user/memberCenter.vue'),
          meta: { hasSearch: false, hasRollToken: false, footer: false },
        },
        // 账单明细
        {
          path: '/user/Billing',
          name: 'Billing',
          component: () => import('@/views/user/Billing.vue'),
          meta: { hasSearch: false, hasRollToken: false, footer: false },
        },
        {
          path: '/user/InviteWelfare',
          name: 'InviteWelfare',
          component: () => import('@/views/user/invitation.vue'),
          meta: { hasSearch: false, hasRollToken: false, footer: false },
        },
      ],
    },
  ],
};
