import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouteReuseStrategy, RouterModule, Routes } from '@angular/router';
import { IonicRouteStrategy } from '@ionic/angular';

export const routes: Routes = [
  {
    path: '',
    loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
  },
  {
    path: 'story-generator',
    loadComponent: () => import('./story-generator/story-generator.page').then(m => m.StoryGeneratorPage)
  },
  {
    path: 'toolbox',
    loadComponent: () => import('./toolbox/toolbox.page').then(m => m.ToolboxPage)
  },
  {
    path: '',
    loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
  },
  {
    path: 'register',
    loadComponent: () => import('./register/register.page').then(m => m.RegisterPage)
  },
  {
    path: 'login',
    loadComponent: () => import('./login/login.page').then(m => m.LoginPage)
  },
  {
    path: 'short-generator',
    loadComponent: () => import('./short-generator/short-generator.page').then(m => m.ShortGeneratorPage)
  },
  {
    path: 'short-novel',
    loadComponent: () => import('./short-novel/short-novel.page').then(m => m.ShortNovelPage)
  }


];





@NgModule({
  imports: [RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }), HttpClientModule],
  exports: [RouterModule],
  providers: [
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
})
export class AppRoutingModule { }
