/*
 * Copyright (C) 2017 Robert Bosch GmbH Copyright (C) 2017 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */
/* eslint-disable @nx/enforce-module-boundaries */

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CloseDetailsGuard } from '@bci-web-core/core';
import { BoschColorComponent } from './bosch-color/bosch-color.component';
import { BoschIconsComponent } from './bosch-icons/bosch-icons.component';
import { DummyComponent } from './dummy/dummy.component';
import { FaqComponent } from './faq/faq.component';
import { LoginComponent } from './login/login.component';
import { OverviewComponent } from './overview/overview.component';

const APP_ROUTES: Routes = [
  {
    path: '',
    pathMatch: 'full',
    component: OverviewComponent,
  },
  {
    path: 'form-controls',
    loadChildren: () =>
      import('apps/core-demo/src/app/form-controls/form-controls.module').then((m) => m.FormControlsModule),
  },
  {
    path: 'navigation',
    loadChildren: () =>
      import('apps/core-demo/src/app/navigation-demo/navigation-demo.module').then((m) => m.NavigationDemoModule),
  },
  {
    path: 'layout-demo',
    loadChildren: () => import('apps/core-demo/src/app/layout-demo/layout-demo.module').then((m) => m.LayoutDemoModule),
  },
  {
    path: 'buttons-indicators',
    loadChildren: () =>
      import('apps/core-demo/src/app/buttons-indicators/buttons-indicators.module').then(
        (m) => m.ButtonsIndicatorsModule
      ),
  },
  {
    path: 'modals-popups',
    loadChildren: () =>
      import('apps/core-demo/src/app/modals-popups/modals-popups.module').then((m) => m.ModalsPopupsModule),
  },
  {
    path: 'master-detail',
    loadChildren: () =>
      import('apps/core-demo/src/app/master-detail/master-detail.module').then((m) => m.MasterDetailModule),
  },
  {
    path: 'data-table-demo',
    loadChildren: () =>
      import('apps/core-demo/src/app/data-table-demo/data-table-demo.module').then((m) => m.DataTableDemoModule),
  },
  {
    path: 'services-demo',
    loadChildren: () =>
      import('apps/core-demo/src/app/services-demo/services-demo.module').then((m) => m.ServicesDemoModule),
  },
  {
    path: 'charts-demo',
    loadChildren: () => import('apps/core-demo/src/app/charts-demo/charts-demo.module').then((m) => m.ChartsDemoModule),
  },
  {
    path: 'colors',
    component: BoschColorComponent,
  },
  {
    path: 'icons',
    component: BoschIconsComponent,
  },
  {
    path: 'level1',
    component: DummyComponent,
    children: [
      {
        path: 'level2',
        component: DummyComponent,
        children: [
          {
            path: 'level3',
            component: DummyComponent,
          },
          {
            path: 'level3-2',
            component: DummyComponent,
          },
        ],
      },
    ],
  },
  {
    path: 'login',
    component: LoginComponent,
    pathMatch: 'full',
  },
  {
    path: 'faq',
    component: FaqComponent,
    pathMatch: 'full',
  },
];

@NgModule({
  imports: [RouterModule.forRoot(APP_ROUTES, {}), RouterModule.forChild(APP_ROUTES)],
  exports: [RouterModule],
  providers: [CloseDetailsGuard],
})
export class AppRoutingModule {}
