import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    { path: '/', redirect: '/subjects' },
    {
      path: '/subjects',
      name: 'subjects',
      component: () => import('@/views/Subjects/index.vue'),
    },
    {
      path: '/profile',
      name: 'profile',
      component: () => import('@/views/Profile.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/settings',
      name: 'settings',
      component: () => import('@/views/settings/index.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/subjects/student-management',
      name: 'student-management',
      component: () => import('@/views/Subjects/StudentManagement.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/subjects/ranking-list',
      name: 'ranking-list',
      component: () => import('@/views/Subjects/RankingList.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/subjects/:subject',
      name: 'subject-detail',
      component: () => import('@/views/Subjects/SubjectDetail.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/subjects/:subject/book/:bookId',
      name: 'textbook-detail',
      component: () => import('@/views/Subjects/TextbookDetail.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/subjects/:subject/video/:bookId',
      name: 'video-learning',
      component: () => import('@/views/Subjects/VideoLearning.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/subjects/:subject/wrong-questions',
      name: 'wrong-questions',
      component: () => import('@/views/Subjects/WrongQuestions.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/subjects/:subject/analysis',
      name: 'subject-analysis',
      component: () => import('@/views/Subjects/SubjectAnalysis.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/answer-questions/wrong-retrain',
      name: 'wrong-retrain-answer',
      component: () => import('@/views/AnswerQuestions/WrongRetrain.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/tasks',
      name: 'tasks',
      component: () => import('@/views/Tasks/index.vue'),
    },
    {
      path: '/english-tools',
      name: 'english-tools',
      component: () => import('@/views/EnglishTools/index.vue'),
    },
    {
      path: '/english-tools/word-book',
      name: 'english-word-book',
      component: () => import('@/views/EnglishTools/WordBook.vue'),
      meta: { hideLayout: true },
    },
    {
      path: '/insights',
      name: 'insights',
      component: () => import('@/views/Insights/index.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/LoginView.vue'),
    },
  ],
})

export default router
