import { NgModule } from '@angular/core';
import { CommonModule, DatePipe } from '@angular/common';
import { CostManagementComponent } from './cost-management.component';
import { RouterModule } from '@angular/router';
import { BreadcrumbModule } from 'src/app/_layout/breadcrumb/breadcrumb.module';
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
import { BlockUIModule } from 'ng-block-ui';
import { BlockTemplateComponent } from 'src/app/_layout/blockui/block-template.component';
import { CardModule } from '../../partials/general/card/card.module';
import { AddEditCostComponent } from './add-edit-cost/add-edit-cost.component';
import { NgSelectModule } from '@ng-select/ng-select';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ClipboardModule } from 'ngx-clipboard';
import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { NgChartsModule } from 'ng2-charts';
import { ChartistModule } from 'ng-chartist';
import { MatchHeightModule } from '../../partials/general/match-height/match-height.module';
import { ModalAddActualComponent } from './modal-add-actual/modal-add-actual.component';



@NgModule({
  declarations: [
    CostManagementComponent,
    AddEditCostComponent,
    ModalAddActualComponent
  ],
  imports: [
    CommonModule,
    CardModule,
    BreadcrumbModule,
    NgSelectModule,
    FormsModule,
    NgbModule,
    ReactiveFormsModule,
    ClipboardModule,
    PerfectScrollbarModule,
    NgxDatatableModule,
    NgChartsModule,
    ChartistModule,
    MatchHeightModule,
    BlockUIModule.forRoot({
      template: BlockTemplateComponent
    }),
    RouterModule.forChild([
      {
        path: '',
        component: CostManagementComponent
      },
      {
        path: 'add-row',
        component: AddEditCostComponent,
        data: { mode: 'add' }
      },
      {
        path: 'edit/:id',
        component: AddEditCostComponent,
        data: { mode: 'edit' } 
      },
      {
        path: 'view/:id',
        component: AddEditCostComponent,
        data: { mode: 'view' } 
      }
    ])
  ],
  providers: [
    DatePipe // Add DatePipe to providers
  ],
})
export class CostManagementModule { }
