import { NgModule } from '@angular/core';
import { Routes } from '@angular/router';
import { NativeScriptRouterModule } from '@nativescript/angular';
import { AuthGuard } from '~/core/services/auth-guard.service';
import { HomeGuard } from '~/core/services/home-guard.service';

import { ProfileComponent } from '~/pages/home/containers/profile/profile.component';
import { HomeComponent } from '~/pages/home/containers/home/home.component';
import { ProfilePageComponent } from './containers/profile-page/profile-page.component';
import { MorePageComponent } from './components/more-page/more-page.component';
import { SearchPageComponent } from './components/search-page/search-page.component';
import { MyUnitPageComponent } from './components/my-unit-page/my-unit-page.component';

const routes: Routes = [
    { path: '', component: HomeComponent, canActivate: [HomeGuard] },
    { path: 'profileOld', component: ProfileComponent, canActivate: [AuthGuard] },
    { path: 'profile', component: ProfilePageComponent, canActivate: [AuthGuard] },
    { path: 'search', component: SearchPageComponent, canActivate: [AuthGuard] },
    { path: 'more', component: MorePageComponent, canActivate: [AuthGuard] },
    { path: 'unit', component: MyUnitPageComponent, canActivate: [AuthGuard] },
];
@NgModule({
    imports: [NativeScriptRouterModule.forChild(routes)],
    exports: [NativeScriptRouterModule]
})
export class HomeRoutingModule {
}
