// Questo file fa parte di MyTown.
// MyTown è software libero: puoi ridistribuirlo e/o modificarlo secondo
// i termini della GNU Affero General Public License come pubblicata dalla
// Free Software Foundation, versione 3.
// Distribuito senza ALCUNA GARANZIA; vedi la GNU AGPL v3 per i dettagli.
// Copyright (C) Kondor Consulting & Services S.r.l.
// SPDX-License-Identifier: AGPL-3.0-or-later

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { OnlineshopComponent } from './onlineshop.component';
import { ProdFiltersModule } from '../prod-filters/prod-filters.module';
import { ProductDetailModule } from '../product-detail/product-detail.module';
import { CartModule } from '../cart/cart.module';
import { OrdersModule } from '../orders/orders.module';


const routes: Routes = [
  	{
      path: '',
      component: OnlineshopComponent,
    },
	{
		path: 'products',
		loadChildren: () => import('../prod-filters/prod-filters.module').then((m) => m.ProdFiltersModule),
	},
  	{
		path: 'products/:id',
		loadChildren: () => import('../prod-filters/prod-filters.module').then((m) => m.ProdFiltersModule),
	},
  	{
		path: 'product-detail/:id',
		loadChildren: () => import('../product-detail/product-detail.module').then((m) => m.ProductDetailModule),
	},
  	{
		path: 'cart',
		loadChildren: () => import('../cart/cart.module').then((m) => m.CartModule),
	},
	{
		path: 'orders',
		loadChildren: () => import('../orders/orders.module').then((m) => m.OrdersModule),
	},
];

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