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

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

const routes: RouteRecordRaw[] = [
  {
    name: 'ApprovalFlowPage',
    path: '/sys/approval/flow',
    redirect: {
      path: '/sys/approval',
      query: {
        tab: 'flow',
      },
    },
    meta: {
      title: $t('approval.tab.flow'),
      hideInMenu: true,
      hideInBreadcrumb: true,
      hideInTab: true,
      activePath: '/sys/approval',
    },
  },
  {
    name: 'ApprovalPendingPage',
    path: '/sys/approval/pending',
    redirect: {
      path: '/sys/approval',
      query: {
        tab: 'pending',
      },
    },
    meta: {
      title: $t('approval.tab.pending'),
      hideInMenu: true,
      hideInBreadcrumb: true,
      hideInTab: true,
      activePath: '/sys/approval',
    },
  },
  {
    name: 'ApprovalProcessedPage',
    path: '/sys/approval/processed',
    redirect: {
      path: '/sys/approval',
      query: {
        tab: 'processed',
      },
    },
    meta: {
      title: $t('approval.tab.processed'),
      hideInMenu: true,
      hideInBreadcrumb: true,
      hideInTab: true,
      activePath: '/sys/approval',
    },
  },
  {
    name: 'ApprovalInitiatedPage',
    path: '/sys/approval/initiated',
    redirect: {
      path: '/sys/approval',
      query: {
        tab: 'initiated',
      },
    },
    meta: {
      title: $t('approval.tab.initiated'),
      hideInMenu: true,
      hideInBreadcrumb: true,
      hideInTab: true,
      activePath: '/sys/approval',
    },
  },
  {
    name: 'ApprovalDetail',
    path: '/sys/approval/detail/:id',
    component: () => import('#/views/system/approval/ApprovalDetail.vue'),
    meta: {
      title: $t('menus.system.approval'),
      hideInMenu: true,
      hideInBreadcrumb: true,
      hideInTab: true,
      activePath: '/sys/approval',
    },
  },
];

export default routes;
