import { BusinessplaygroundComponent } from '../businessplayground/businessplayground.component';
import { CandidateDetailsComponent } from '../coach/candidate-details/candidate-details.component';
import { CFlandingComponent } from '../coach/cflanding/cflanding.component';
import { DashboardComponent } from '../dashboard/dashboard.component';
import { EnsureAuthenticated } from '../services/ensure-authenticated.service';
import { fbRedirectComponent } from '../redirectUrl/fb.redirectUrl';
import { FilterComponentComponent } from '../filter-component/filter-component.component';
import { IntroductionComponent } from '../introduction/introduction.component';
import { LoginComponent } from '../login/log.component';
import { MainComponent } from '../main/main.component';
import { PagenotfoundComponent } from '../pagenotfound/pagenotfound.component';
import { PgcoachdetailsComponent } from '../pgcoachdetails/pgcoachdetails.component';
import { PrimaryskillplaygroundComponent } from '../primaryskillplayground/primaryskillplayground.component';
import { RouterModule, Routes } from '@angular/router';
import { ServerStopComponentComponent } from '../server-stop-component/server-stop-component.component';
import { SignupComponent } from '../signup/signup.component';
import { TechnicalplaygroundComponent } from '../technicalplayground/technicalplayground.component';
import { SignUpAsStudentComponent } from '../signupasstudent/signupasstudent.component';
import { ForgotPasswordComponent } from '../forgot-password/forgot-password.component';
// System imports

const appRoutes: Routes = [
  {
    path: 'home',
    component: MainComponent
  },
  {
    path: '',
    component: LoginComponent,
   // canActivate: [LoginRedirect]
  },
  { path: 'pgm', loadChildren: 'app/routing-modules/pgm-routing.module#PgmRoutingModule'},
  { path: 'employee', loadChildren: 'app/routing-modules/emp-routing.module#EmpRoutingModule'},
  {path: 'candidate', loadChildren:'app/routing-modules/candidate-routing.module#CandiadateRoutingModule'},
  { path: 'admin', loadChildren: 'app/routing-modules/admin-routing.module#AdminRoutingModule'},
  { path: 'coach', loadChildren: 'app/routing-modules/coach-routing.module#CoachRoutingModule'},
  { path: 'ta', loadChildren: 'app/routing-modules/ta-routing.module#TaRoutingModule'},
  {
    path: 'signup',
    component: SignUpAsStudentComponent
  },
  {
    path: 'forgotpassword',
    component: ForgotPasswordComponent
  },
  {
    path: 'introduction',
    component: IntroductionComponent
  },
  {
    path: 'dashboard',
    /*canActivate:[AuthGuard],*/
    component: DashboardComponent,
    canActivate: [EnsureAuthenticated]
  },
  {
    path: 'primaryPlayground',
    component: PrimaryskillplaygroundComponent
  },
  {
    path: 'technicalPlayground',
    component: TechnicalplaygroundComponent,
  },
  {
    path: 'businessPlayground',
    component: BusinessplaygroundComponent,
  },
  { path: 'comingSoon', component: PagenotfoundComponent },
  { path: 'filter', component: FilterComponentComponent },
  { path: 'facebookIdentity', component: fbRedirectComponent },
  { path: 'linkedInIdentity', component: fbRedirectComponent },
  { path: 'googleIdentity', component: fbRedirectComponent },
  { path: 'o365Identity', component: fbRedirectComponent },
  { path: 'o365DavintaIdentity', component: fbRedirectComponent },

  { path: 'CFlanding', component: CFlandingComponent },
  { path: 'CandidateDetails', component: CandidateDetailsComponent },

  { path: 'pgCoachdetails/:id', component: PgcoachdetailsComponent },
  { path: 'serverStop', component: ServerStopComponentComponent },

];

export const AppRoutingModule = RouterModule.forRoot(appRoutes, { enableTracing: true });
