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

import { HomeComponent } from './home';
import { LoginComponent } from './login';
import { RegisterComponent } from './register';
import { FormComponent } from './form';
import { AuthGuard } from './_helpers';
import {UsersComponent} from "@/users";
import {CompanyComponent} from "@/company";

const routes: Routes = [
    { path: '', component: HomeComponent, canActivate: [AuthGuard] },
    { path: 'login', component: LoginComponent },
    { path: 'register', component: RegisterComponent },
    { path: 'form', component: FormComponent },
    { path: 'users', component: UsersComponent },
    { path: 'companies', component: CompanyComponent },

    // otherwise redirect to home
    { path: '**', redirectTo: '' }
];

export const appRoutingModule = RouterModule.forRoot(routes);