import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CheckoutReviewComponent } from './checkout-review/checkout-review.component';
import { CheckoutSummaryComponent } from './checkout-summary/checkout-summary.component';
import { PageCheckoutComponent } from './page-checkout.component';

const routes: Routes = [
  {
    path: '',
    component: PageCheckoutComponent,
    children: [
      { path: 'summary', component: CheckoutSummaryComponent },
      { path: 'summary/:orderIds', component: CheckoutSummaryComponent },
      { path: 'review', component: CheckoutReviewComponent },
      { path: '', pathMatch: 'full', redirectTo: 'review' },
    ],
  },
];

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