import { Routes } from '@angular/router';
import { ShellComponent } from '@shared/layout/shell/shell.component';
import { authGuard } from '@auth/auth.guard';

export const routes: Routes = [
  {
    path: '',
    component: ShellComponent, // persistent header/footer; only children swap
    children: [
      { path: '', pathMatch: 'full', redirectTo: 'login' },
      {
        path: 'login',
        loadComponent: () => import('@auth/ui/login.page').then((m) => m.LoginPage),
      },
      {
        path: 'dashboard',
        canActivate: [authGuard],
        loadComponent: () => import('@registratie/ui/dashboard.page').then((m) => m.DashboardPage),
      },
      {
        path: 'registratie',
        canActivate: [authGuard],
        loadComponent: () =>
          import('@registratie/ui/registration-detail.page').then((m) => m.RegistrationDetailPage),
      },
      {
        path: 'aanvraag/:id',
        canActivate: [authGuard],
        loadComponent: () =>
          import('@registratie/ui/aanvraag-detail.page').then((m) => m.AanvraagDetailPage),
      },
      {
        path: 'registreren',
        canActivate: [authGuard],
        loadComponent: () =>
          import('@registratie/ui/registratie.page').then((m) => m.RegistratiePage),
      },
      {
        path: 'herregistratie',
        canActivate: [authGuard],
        loadComponent: () =>
          import('@herregistratie/ui/herregistratie.page').then((m) => m.HerregistratiePage),
      },
      {
        path: 'intake',
        canActivate: [authGuard],
        loadComponent: () => import('@herregistratie/ui/intake.page').then((m) => m.IntakePage),
      },
      {
        path: 'brief',
        canActivate: [authGuard],
        loadComponent: () => import('@brief/ui/brief.page').then((m) => m.BriefPage),
      },
      {
        path: 'concepts',
        loadComponent: () => import('./showcase/concepts.page').then((m) => m.ConceptsPage),
      },
      { path: '**', redirectTo: 'login' },
    ],
  },
];
