import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AppMainComponent } from './app.main.component';
import { CandidatListComponent } from './pages/candidat/candidat-list/candidat-list.component';
import { DashboardComponent } from './pages/dashboard/dashboard/dashboard.component';

export const appRouteList: Routes = [
    {
        path: 'app', component: AppMainComponent,
        loadChildren: () => import('./pages/pages.routing.module').then(m => m.PagesRoutingModule)
    }
];

@NgModule({
    imports: [
        RouterModule.forRoot([
            {
                path: '', component: AppMainComponent,
                children: [
                    {path: 'candidat/candidat-list', component: CandidatListComponent},
                    {path: 'dashboard', component: DashboardComponent},
                ]
            },
            {path: '**', redirectTo: '/notfound'},
        ], {scrollPositionRestoration: 'enabled'})
    ],
    exports: [RouterModule]
})
export class AppRoutingModule {
}
