import { NgModule } from '@angular/core';
import { mapToCanActivate, RouterModule, Routes } from '@angular/router';
import { TextbookDetailsComponent } from './textbook-details/textbook-details.component';
import { AuthGuard } from './auth.guard';
import { NotFound404Component } from '../common/not-found404/not-found404.component';
const routes: Routes = [
  {
    path: '',
    redirectTo:'review/detail',
    pathMatch: "full",
  },
  {
    path: 'review',
    canActivate: mapToCanActivate([AuthGuard]),
    children: [
      {
        path: 'detail/:id', 
        component: TextbookDetailsComponent,
      },
    ],
  },
  {
    path: '404',
    component: NotFound404Component,
  }
];
@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class ReviewRoutingModule {}
