import { enforceAuth } from '@/router'
import type { RouteRecordRaw } from 'vue-router'

export function createClassroomComplianceRoutes(): RouteRecordRaw {
  return {
    path: '/classroom-compliance',
    component: () => import('@/apps/classroom_compliance/MainView.vue'),
    beforeEnter: [enforceAuth],
    children: [
      {
        path: '',
        component: () => import('@/apps/classroom_compliance/ClassesView.vue'),
      },
      {
        path: 'classes/:id',
        component: () => import('@/apps/classroom_compliance/ClassView.vue'),
        props: true,
      },
      {
        path: 'edit-class',
        component: () => import('@/apps/classroom_compliance/EditClassView.vue'),
      },
      {
        path: 'classes/:classId/students/:studentId',
        component: () => import('@/apps/classroom_compliance/StudentView.vue'),
        props: true,
      },
      {
        path: 'classes/:classId/edit-student',
        component: () => import('@/apps/classroom_compliance/EditStudentView.vue'),
        props: true,
      },
      {
        path: 'classes/:classId/import-students',
        component: () => import('@/apps/classroom_compliance/ImportStudentsView.vue'),
        props: true,
      },
      {
        path: 'guide',
        component: () => import('@/apps/classroom_compliance/GuideView.vue'),
      },
    ],
  }
}
