import {NgModule} from "@angular/core";
import {RouterModule, Routes} from "@angular/router";
import {AccessDeniedComponent} from "./component/access-denied.component";
import {AuthGuard} from "../security/guard/auth.guard";
import {ConfirmExitGuard} from "@webbpm/base-package";
import {HomeLandingComponent} from "./component/home-landing.component";

const appRoutes: Routes = [
  {
    path: 'access-denied',
    component: AccessDeniedComponent,
    canActivate: [ConfirmExitGuard]
  },

  {
    path: 'mydata',
    loadChildren: 'generated-sources/page-mydata.module#PagemydataModule',
    canActivate: [AuthGuard],
  },
  {
    path: 'restriction',
    loadChildren: 'generated-sources/page-restriction.module#PagerestrictionModule',
    canActivate: [AuthGuard],
  },
  {
    path: 'subpoena',
    loadChildren: 'generated-sources/page-subpoena.module#PagesubpoenaModule',
    canActivate: [AuthGuard],
  },
  {
    path: 'home',
    component: HomeLandingComponent,
    canActivate: [ConfirmExitGuard],
  },
];

@NgModule({
  imports: [RouterModule.forChild(appRoutes)],
  exports: [RouterModule]
})
export class AppRoutingModule {

}
