// Angular
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
// Components
import { AuthGuard } from '../core/guard/auth.guard';
import { BaseComponent } from './base/base.component';
import { unauthorizedComponent } from './unauthorized/unauthorized.component';
// Auth

const routes: Routes = [
  {
    path: '',
    canActivate: [AuthGuard],
    component: BaseComponent,
    children: [
      {
        path: "Unauthorized",
        component: unauthorizedComponent,
      },
      {
        path: 'BookingManagement',
        loadChildren: () =>
          import('../modules/booking-management/booking-management.module').then(
            (m) => m.BookingManagementModule
          ),
      },
      {
        path: 'Services',
        loadChildren: () =>
          import('../modules/services/services.module').then((m) => m.ServicesModule),
      },
      {
        path: 'UserConfiguration',
        loadChildren: () =>
          import('../modules/user-configuration/user-configuration.module').then((m) => m.UserConfigurationModule),
      },
      {
        path: 'ActivityConfiguration',
        loadChildren: () =>
          import('../modules/services/activity-config/activity-config.module').then((m) => m.ActivityConfigModule),
      },
      // {
      //   path: 'Error/403',
      //   data: {
      //     type: 'error-v6',
      //     code: 403,
      //     title: '403... Access forbidden',
      //     desc: "Looks like you don't have permission to access for requested page.<br> Please, contact administrator",
      //   },
      // },
      // {
      //   path: 'Error/404',
      //   data: {
      //     type: 'error-v4',
      //   },
      // },
      // { path: 'Error/:type' },
      { path: '', redirectTo: '', pathMatch: 'full' },
      { path: '**', redirectTo: 'Error/404', pathMatch: 'full' },
    ],
  },
];

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