import type { RouteRecordRaw } from 'vue-router';

import { BasicLayout } from '#/layouts';
import { $t } from '#/locales';

const routes: RouteRecordRaw[] = [
  {
    component: BasicLayout,
    meta: {
      icon: 'lucide:layout-dashboard',
      order: -1,
      title: $t('page.dashboard.title'),
    },
    name: 'Dashboard',
    path: '/dashboard',
    children: [
      {
        name: 'Analytics',
        path: '/analytics',
        component: () => import('#/views/dashboard/analytics/index.vue'),
        meta: {
          affixTab: false,
          icon: 'lucide:area-chart',
          title: $t('page.dashboard.analytics'),
        },
      },
      {
        name: 'ServerList',
        path: '/server-list',
        component: () => import('#/views/dashboard/serverList/index.vue'),
        meta: {
          affixTab: false,
          icon: 'lucide:gamepad',
          title: $t('page.dashboard.server-list'),
          authority: ['super', 'admin'],
        },
      },
      {
        name: 'AppList',
        path: '/app-list',
        component: () => import('#/views/dashboard/appList/index.vue'),
        meta: {
          affixTab: false,
          icon: 'lucide:app-window',
          title: $t('page.dashboard.app-list'),
          authority: ['super', 'admin'],
        },
      },
      {
        name: 'NodeList',
        path: '/node-list',
        component: () => import('#/views/dashboard/nodeList/index.vue'),
        meta: {
          affixTab: false,
          icon: 'lucide:server',
          title: $t('page.dashboard.node-list'),
          authority: ['super', 'admin'],
        },
      },
      {
        name: 'MysqlList',
        path: '/mysql-list',
        component: () => import('#/views/dashboard/mysqlList/index.vue'),
        meta: {
          affixTab: false,
          icon: 'lucide:database',
          title: $t('page.dashboard.mysql-list'),
          authority: ['super', 'admin'],
        },
      },
    ],
  },
];

export default routes;
