import {Routes} from '@angular/router';
import {AuthLayoutComponent} from './core';
import {AdminLayoutComponent} from './core/admin-layout/admin-layout.component';
import {AuthGuard} from './classes/guards/auth.guard';

export const AppRoutes: Routes = [{
  path: '',
  component: AdminLayoutComponent,
  canActivate : [AuthGuard],
  children: [{
    canActivate: [AuthGuard],
    path: 'user',
    loadChildren: './components/user/user.module#UserModule'
  },
    {
      canActivate: [AuthGuard],
      path: '',
      loadChildren: './components/mainpage/mainpage.module#MainpageModule'
    },
    {
      canActivate: [AuthGuard],
      path: 'requests',
      loadChildren: './components/requests/requests.module#RequestsModule'
    },
    {
      canActivate: [AuthGuard],
      path: 'basics',
      loadChildren: './components/basics/basics.module#BasicsModule'
    },
  ]
}, {
  path: '',
  component: AuthLayoutComponent,
  children: [{
    path: 'auth',
    loadChildren: './components/auth/auth.module#AuthModule'
  } ,

  ]
}, {
  path: '**',
  redirectTo: 'auth/404'
}];
