import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AuthGuard} from './shared/guards/auth.guard';

const routes: Routes = [
    {
        path: '',
        redirectTo: 'home',
        pathMatch: 'full'
    },
    {
        path: 'home',
        loadChildren: () => import('./home/home.module').then(m => m.HomeModule),
    },
    {
        path: 'auth',
        loadChildren: () => import('./authorization/authorization.module').then(m => m.AuthorizationModule),
    },
    {
        path: 'sync',
        loadChildren: () => import('./sync/sync.module').then(m => m.SyncModule),
        canActivate: [AuthGuard],
    },
    {
        path: 'list',
        loadChildren: () => import('./followings-list/followings-list.module').then(m => m.FollowingsListModule),
        canActivate: [AuthGuard],
    },
    {
        path: 'matrix',
        loadChildren: () => import('./followings-matrix/followings-matrix.module').then(m => m.FollowingsMatrixModule),
        canActivate: [AuthGuard],
    },
    {
        path: 'table',
        loadChildren: () => import('./followings-table/followings-table.module').then(m => m.FollowingsTableModule),
        canActivate: [AuthGuard],
    },
];

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