import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { UserViewComponent } from './user-view/user-view.component';
import { UserAddComponent } from './user-add/user-add.component';
import { MatMenuModule } from '@angular/material/menu';
import { InputTextModule } from 'primeng/inputtext';
import { TableModule } from 'primeng/table';
import { ToolbarModule } from 'primeng/toolbar';
import { RouterModule, Routes } from '@angular/router';
import { NgSelectModule } from '@ng-select/ng-select';
import { ButtonModule } from 'primeng/button';
import { DialogModule } from 'primeng/dialog';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { InterceptLoader } from 'src/app/core/common/intercept-loader.service';
import { ToastModule } from 'primeng/toast';
import { MessageService } from 'primeng/api';
import { MatButtonModule } from '@angular/material/button';

const routes: Routes = [
  {
    path: 'Search',
    component: UserViewComponent,
  },
  {
    path: 'Add',
    component: UserAddComponent,
  },
  {
    path: 'Edit/:RuleId',
    component: UserAddComponent,
  },
]

@NgModule({
  declarations: [
    UserViewComponent,
    UserAddComponent
  ],
  imports: [
    DialogModule,
    ReactiveFormsModule,
    FormsModule,
    TableModule,
    CommonModule,
    ButtonModule,
    MatMenuModule,
    ToastModule,
    ToolbarModule,
    NgSelectModule,
    InputTextModule,
    MatButtonModule,
    RouterModule.forChild(routes),
  ], providers: [MessageService,
    { provide: HTTP_INTERCEPTORS, useClass: InterceptLoader, multi: true }
  ],
})
export class UserManagementModule { }
