import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';

import { IonicModule } from '@ionic/angular';

import { ContractsPage } from './contracts.page';
import { TranslateModule } from '@ngx-translate/core'

const routes: Routes = [
  {
        path: '',
        redirectTo: '/contracts/pending',
        pathMatch: 'full'
  },
  {
    path: '',
    component: ContractsPage,
    children: [
      {
        path: 'pending',
        loadChildren: () => import('./pending/pending.module').then(m => m.PendingPageModule)
      },
      {
        path: 'redated',
        loadChildren: () => import('./redated/redated.module').then(m => m.RedatedPageModule)
      },
      {
        path: 'contracted',
        loadChildren: () => import('./contracted/contracted.module').then(m => m.ContractedPageModule)
      },
      {
        path: 'finished',
        loadChildren: () => import('./finished/finished.module').then(m => m.FinishedPageModule)
      },
      {
        path: 'reported',
        loadChildren: () => import('../reports/reports.module').then(m => m.ReportsPageModule)
      }
    ]
  }
];

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    RouterModule.forChild(routes),
    TranslateModule
  ],
  declarations: [ContractsPage]
})
export class ContractsPageModule {}
