import { Routes } from '@angular/router';
import { authGuard } from '@app/core/guard/authentication/auth.guard';

export const routes: Routes = [
  {
    path: '',
    title: 'Accueil',
    loadChildren: () => import('./views/home/home.module').then((m) => m.HomeModule),
  },
  {
    path: 'home',
    title: 'Accueil',
    loadChildren: () => import('./views/home/home.module').then((m) => m.HomeModule),
  },
  {
    path: 'profiles',
    title: 'Liste des profiles',
    loadChildren: () => import('./views/profile/profile.module').then((m) => m.ProfileModule),
  },
  {
    path: 'auth',
    title: 'Authentification',
    loadChildren: () =>
      import('./views/authentification/authentification.module').then(
        (m) => m.AuthentificationModule
      ),
  },
  {
    path: 'my-profile',
    title: 'Mon profile',
    canActivate: [authGuard],
    loadChildren: () =>
      import('./views/my-profile/my-profile.module').then((m) => m.MyProfileModule),
  },
  {
    path: 'not-found',
    title: 'Page non trouvée',
    loadChildren: () => import('./views/not-found/not-found.module').then((m) => m.NotFoundModule),
  },
  { path: '', redirectTo: '/', pathMatch: 'full' },
  { path: '**', redirectTo: '/not-found' },
];
