import { createRouter, createWebHistory } from 'vue-router'
import { systemRoutes } from './whitelist'
 


const LAYOUT = () => import('@/layout/app/index.vue')

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [ 
    {
      path: "/",
      name: "main",
      redirect: "me",
      component: LAYOUT,
      children: [
        { 
          path: "im",
          name: "im",
          meta: { title: "社交", keepAlive: false,  navbar: true },
          component: () => import("@/views/home/index.vue"),
        },
        {
          path: "transaction",
          name: "transaction",
          meta: { title: "交易", keepAlive: false,   navbar: true  },
          component: () => import("@/views/transaction/index.vue"),
        },
        {
          path: "wallet",
          name: "wallet",
          meta: { title: "钱包", keepAlive: false,   navbar: true  },
          component: () => import("@/views/wallet/index.vue"),
        },
        {
          path: "dapp",
          name: "dapp",
          meta: { title: "DAPP", keepAlive: false,   navbar: true },
          component: () => import("@/views/dapp/index.vue"),
        },
        {
          path: "me",
          name: "me",
          meta: { title: "我的", keepAlive: false,   navbar: false  },
          component: () => import("@/views/me/index.vue"),
        }
      ],
    },
    ...systemRoutes
  ],
})

export default router
