import { Routes } from '@angular/router';

export const routes: Routes = [
  { path: '', redirectTo: 'students', pathMatch: 'full' },
  {
    path: 'students',
    loadComponent: () =>
      import('@features/students/pages/student-list/student-list.component')
        .then(m => m.StudentListComponent),
  },
  {
    path: 'students/new',
    loadComponent: () =>
      import('@features/students/pages/student-form/student-form.component')
        .then(m => m.StudentFormComponent),
  },
  {
    path: 'students/:id/edit',
    loadComponent: () =>
      import('@features/students/pages/student-form/student-form.component')
        .then(m => m.StudentFormComponent),
  },
  {
    path: 'enrollment/:studentId',
    loadComponent: () =>
      import('@features/enrollment/pages/enrollment-page/enrollment-page.component')
        .then(m => m.EnrollmentPageComponent),
  },
  {
    path: 'classmates/:studentId',
    loadComponent: () =>
      import('@features/classmates/pages/classmates-page/classmates-page.component')
        .then(m => m.ClassmatesPageComponent),
  },
  { path: '**', redirectTo: 'students' },
];
