import type { RouteRecordRaw } from 'vue-router'

const Layout = () => import('@/layouts/index.vue')

const routes: RouteRecordRaw[] = [
  {
    path: '/breadcrumb_example',
    component: Layout,
    redirect: '/breadcrumb_example/list1',
    name: 'breadcrumbExample',
    meta: {
      title: '面包屑导航',
      i18n: 'route.breadcrumb.root',
      icon: 'ic:twotone-double-arrow',
    },
    children: [
      {
        path: 'list1',
        name: 'breadcrumbExampleList1',
        component: () => import('@/views/example/breadcrumb_example/list1.vue'),
        meta: {
          title: '列表1（平级模式）',
        },
      },
      {
        path: 'detail1',
        name: 'breadcrumbExampleDetail1',
        component: () => import('@/views/example/breadcrumb_example/detail1.vue'),
        meta: {
          title: '详情1',
          sidebar: false,
          activeMenu: '/breadcrumb_example/list1',
        },
      },
      {
        path: 'list2',
        name: 'breadcrumbExampleList2',
        redirect: '/breadcrumb_example/list2',
        meta: {
          title: '列表2（层级模式）',
          i18n: 'route.breadcrumb.list2',
        },
        children: [
          {
            path: '',
            component: () => import('@/views/example/breadcrumb_example/list2.vue'),
            meta: {
              title: '列表2（层级模式）',
              sidebar: false,
              breadcrumb: false,
            },
          },
          {
            path: 'detail2',
            name: 'breadcrumbExampleDetail2',
            component: () => import('@/views/example/breadcrumb_example/detail2.vue'),
            meta: {
              title: '详情2',
              sidebar: false,
              activeMenu: '/breadcrumb_example/list2',
            },
          },
        ],
      },
    ],
  },
  {
    path: '/multilevel_menu_example',
    component: Layout,
    redirect: '/multilevel_menu_example/page',
    name: 'multilevelMenuExample',
    meta: {
      title: '多级导航',
      i18n: 'route.multimenu.root',
      icon: 'heroicons-solid:menu-alt-3',
    },
    children: [
      {
        path: 'page',
        name: 'multilevelMenuExample1',
        component: () => import('@/views/example/multilevel_menu_example/page.vue'),
        meta: {
          title: '导航1',
        },
      },
      {
        path: 'level2',
        name: 'multilevelMenuExample2',
        redirect: '/example/multilevel_menu_example/level2/page',
        meta: {
          title: '导航2',
        },
        children: [
          {
            path: 'page',
            name: 'multilevelMenuExample2-1',
            component: () => import('@/views/example/multilevel_menu_example/level2/page.vue'),
            meta: {
              title: '导航2-1',
            },
          },
          {
            path: 'level3',
            name: 'multilevelMenuExample2-2',
            redirect: '/example/multilevel_menu_example/level2/level3/page1',
            meta: {
              title: '导航2-2',
            },
            children: [
              {
                path: 'page1',
                name: 'multilevelMenuExample2-2-1',
                component: () => import('@/views/example/multilevel_menu_example/level2/level3/page1.vue'),
                meta: {
                  title: '导航2-2-1',
                },
              },
              {
                path: 'page2',
                name: 'multilevelMenuExample2-2-2',
                component: () => import('@/views/example/multilevel_menu_example/level2/level3/page2.vue'),
                meta: {
                  title: '导航2-2-2',
                },
              },
            ],
          },
        ],
      },
    ],
  },
]

export default routes
