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

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

const routes: RouteRecordRaw[] = [
  {
    component: BasicLayout,
    meta: {
      icon: 'material-symbols:brightness-empty-outline',
      order: -1,
      title: $t('page.admin.title'),
      authority: ['super', 'AC1001', 'AC1101', 'AC1107', 'AC1113', 'AC1117'],
    },
    name: 'Admin',
    path: '/admin',
    children: [
      {
        name: 'UserManagement',
        path: '/user-management',
        component: () => import('#/views/admin/user/index.vue'),
        meta: {
          authority: ['super', 'AC1001', 'AC1002'],
          affixTab: false,
          icon: 'majesticons:user-box-line',
          title: $t('page.admin.user'),
        },
      },
      {
        name: 'UserManagementLog',
        path: '/user-management-log',
        component: () => import('#/views/admin/log/index.vue'),
        meta: {
          authority: ['super', 'AC1003'],
          affixTab: false,
          icon: 'material-symbols:assignment-rounded',
          title: $t('page.admin.log'),
        },
      },
      {
        name: 'UserManagementConfig',
        path: '/user-management-config',
        component: () => import('#/views/admin/config/index.vue'),
        meta: {
          authority: ['super', 'AC1004', 'AC1005', 'AC1006'],
          affixTab: false,
          icon: 'material-symbols:assignment-rounded',
          title: $t('page.admin.config'),
        },
      },
      {
        name: 'PermissionUserGroup',
        path: '/permission/user-group',
        component: () => import('#/views/admin/permission/user-group.vue'),
        meta: {
          authority: ['super', 'AC1101', 'AC1102', 'AC1103', 'AC1104', 'AC1105', 'AC1106'],
          affixTab: false,
          icon: 'material-symbols:group',
          title: $t('page.admin.permission.userGroup'),
        },
      },
      {
        name: 'PermissionRole',
        path: '/permission/role',
        component: () => import('#/views/admin/permission/role.vue'),
        meta: {
          authority: ['super', 'AC1107', 'AC1108', 'AC1109', 'AC1110', 'AC1111', 'AC1112'],
          affixTab: false,
          icon: 'material-symbols:shield-person',
          title: $t('page.admin.permission.role'),
        },
      },
      {
        name: 'PermissionItem',
        path: '/permission/permission',
        component: () => import('#/views/admin/permission/permission.vue'),
        meta: {
          authority: ['super', 'AC1113', 'AC1114', 'AC1115', 'AC1116'],
          affixTab: false,
          icon: 'material-symbols:key',
          title: $t('page.admin.permission.permission'),
        },
      },
      {
        name: 'PermissionUserAssign',
        path: '/permission/user-assign',
        component: () => import('#/views/admin/permission/user-assign.vue'),
        meta: {
          authority: ['super', 'AC1117', 'AC1118', 'AC1119', 'AC1120', 'AC1121'],
          affixTab: false,
          icon: 'material-symbols:manage-accounts',
          title: $t('page.admin.permission.userAssign'),
        },
      },
    ],
  },
];

export default routes;
