import { Routes } from '@angular/router';
import { TabsPage } from './tabs.page';
import { TokenGuard } from 'src/lib/user/token-guard/token.guard';
import { TestGuard } from './test.guard';

export const routes: Routes = [
  {
    path: 'tabs',
    component: TabsPage,
    children: [
      {
        path: 'tab1',
        canActivate:[TokenGuard],
        loadComponent: () =>
          import('../../modules/flow/page-flow-test/page-flow-test.component').then((m) => m.PageFlowTestComponent),
          // import('../tab1/tab1.page').then((m) => m.Tab1Page),
      },
      {
        path: 'tab2',
        canActivate:[TokenGuard,TestGuard],
        loadComponent: () =>
          import('../tab2/tab2.page').then((m) => m.Tab2Page),
      },
      {
        path: 'tab3',
        canActivate:[TokenGuard],
        loadComponent: () =>
          import('../tab3/tab3.page').then((m) => m.Tab3Page),
      },
      {
        path: '',
        redirectTo: '/tabs/tab3',
        pathMatch: 'full',
      },
    ],
  },
  {
    path: '',
    redirectTo: '/tabs/tab1',
    pathMatch: 'full',
  },
];
