import { NgModule } from '@angular/core';
import { Routes, RouterModule, PreloadAllModules } from '@angular/router';

const routes: Routes = [
    {
        path: 'calculator',
        loadChildren: () => import('./components/calculator/calculator.module').then(m => m.CalculatorModule)
    },
    {
        path: 'dashboard',
        loadChildren: () => import('./components/dashboard/dashboard.module').then(m => m.DashboardModule)
    },
    {
        path: 'jump',
        loadChildren: () => import('./components/jump/jump.module').then(m => m.JumpModule)
    },
    {
        path: 'logbook',
        loadChildren: () => import('./components/logbook/logbook.module').then(m => m.LogbookModule)
    },
    {
        path: 'profile',
        loadChildren: () => import('./components/profile/profile.module').then(m => m.ProfileModule)
    },
    {
        path: 'qcm',
        loadChildren: () => import('./components/qcm/qcm.module').then(m => m.QCMModule)
    },
    {
        path: 'settings',
        loadChildren: () => import('./components/settings/settings.module').then(m => m.SettingsModule)
    }
];

/* @NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
}) */
@NgModule({
    imports: [RouterModule.forRoot(routes, {
        // preload all modules; optionally we could
        // implement a custom preloading strategy for just some
        // of the modules (PRs welcome 😉)
        preloadingStrategy: PreloadAllModules
    })],
    exports: [RouterModule]
})
export class AppRoutingModule { }
