import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import {PublicComponent} from "./components/public/public.component";
import {PrivateComponent} from "./components/private/private.component";
import {AuthGuard} from "./guards/auth.guard";

//import { AuthGuard } from '@auth0/auth0-angular';
import {AgregarResComponent} from "./components/agregar-res/agregar-res.component";
import {AgregarUsuarioComponent} from "./components/agregar-usuario/agregar-usuario.component";
import {MesasRestarantComponent} from "./components/mesas-restarant/mesas-restarant.component";
import {SectoresComponent} from "./components/sectores/sectores.component";


const routes: Routes = [
  { path: 'public', component:PublicComponent},
  { path: 'private', component:PrivateComponent, canActivate: [AuthGuard]},
  {path: 'agregar.res', component:AgregarResComponent, canActivate:[AuthGuard]},
  {path: 'agregar.usu', component:AgregarUsuarioComponent, canActivate:[AuthGuard]},
  {path: 'mesaRers', component:MesasRestarantComponent, canActivate:[AuthGuard]},
  {path: 'sectoresRes', component:SectoresComponent, canActivate:[AuthGuard]},
  {path: '**', pathMatch: 'full', redirectTo: 'public'}
];

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