import {NgModule} from '@angular/core';
import {RouterModule, Routes} from "@angular/router";

import {LoginComponent} from "../component/login/login.component";
import {RegisterComponent} from "../component/register/register.component";
import {UserComponent} from "../component/user/user.component";
import {AuthenticationGuard} from "../guard/authentication.guard";
import {ManagementComponent} from "../component/management/management.component";
import {UsersComponent} from "../component/management/users/users.component";
import {SettingsComponent} from "../component/management/settings/settings.component";
import {ProfileComponent} from "../component/management/profile/profile.component";
import {UserEditComponent} from "../component/management/users/user-edit/user-edit.component";
import {UserViewComponent} from "../component/management/users/user-view/user-view.component";
import {UserResolver} from "../component/management/users/user-resolver.service";
import { ProfessorComponent } from '../component/professor/professor.component';
import { HomeComponent } from '../component/home/home.component';
import { EventComponent } from '../component/event/event.component';
import { BlogComponent } from '../component/blog/blog.component';
import { EventFormComponent } from '../component/event-form/event-form.component';

const routes: Routes = [
  { path: '', component: HomeComponent },

  { path: 'login', component: LoginComponent },
  { path: 'home', component: HomeComponent },
  { path: 'register', component: RegisterComponent },
  { path: 'settings', component: SettingsComponent, canActivate: [AuthenticationGuard] },
  { path: 'profile', component: ProfileComponent, canActivate: [AuthenticationGuard] },
  { path: 'events', component: EventComponent, canActivate: [AuthenticationGuard] },
  { path: 'eventForm', component: EventFormComponent, canActivate: [AuthenticationGuard] },
  { path: 'eventForm/:id', component: EventFormComponent, canActivate: [AuthenticationGuard] },
  { path: 'blogs', component: BlogComponent, canActivate: [AuthenticationGuard] },
  { path: 'userManagement', component: UserComponent, canActivate: [AuthenticationGuard] },
  { path: 'professorManagement', component: ProfessorComponent, canActivate: [AuthenticationGuard] },
  {
    path: '',
    redirectTo: 'login',
    pathMatch: 'full'
},
];



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