import {RouterModule, Routes} from '@angular/router';
import {HomeComponent} from '../components/home.component/home.component';
import {MainComponent} from './main.component/main.component';
import {TutorialsListComponent} from '../components/tutorials-list/tutorials-list.component';
import {TutorialsComponent} from '../components/tutorials.component/tutorials.component';
import {AddTutorialComponent} from '../components/add-tutorial/add-tutorial.component';
import {RegisterComponent} from '../components/register/register.component';
import {ProfileComponent} from '../components/profile/profile.component';
import {GenerateImageComponent} from '../components/generate-image.component/generate-image.component';

const MAIN_ROUTES: Routes =[
  {
    path: '',
    component: MainComponent,
    children: [
      {
        path: 'admin',
        loadChildren: () =>
          import('../admin-module/admin.module').then((m) => m.AdminModule),
      },
      {
        path: 'user',
        loadChildren: () =>
          import('../user-module/user.module').then((m) => m.UserModule),
      },
      {
        path: 'home',
        component: HomeComponent
      },
      {
        path: 'generate-image',
        component: GenerateImageComponent
      },
      {
        path: 'tutorials',
        component: TutorialsComponent
      },
      {
        path: 'add-tutorial',
        component: AddTutorialComponent
      },
      {
        path: 'register',
        component : RegisterComponent
      },
      {
        path: 'profile',
        component : ProfileComponent
      }
    ],
  }
];

export const mainRouting = RouterModule.forChild(MAIN_ROUTES);
