import { ScrollingModule } from '@angular/cdk/scrolling';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { DomainCatalogModule } from '@domain/catalog';
import { UiCommonModule } from '@ui/common';
import { UiIconModule } from '@ui/icon';
import { UiSelectBulletModule } from '@ui/select-bullet';
import { UiTooltipModule } from '@ui/tooltip';
import { UiSpinnerModule } from '@ui/spinner';
import { AddedToCartModalComponent } from './added-to-cart-modal/added-to-cart-modal.component';
import { StockInfosPipe } from './order-by-filter/stick-infos.pipe';
import { SearchResultItemLoadingComponent } from './search-result-item-loading.component';
import { SearchResultItemComponent } from './search-result-item.component';
import { ArticleSearchResultsComponent } from './search-results.component';
import { SearchResultSelectedPipe } from './selected/search-result-selected.pipe';
import { FilterAutocompleteProvider, FilterModule, OrderByFilterModule } from '@shared/components/filter';
import { FocusSearchboxEvent } from '../focus-searchbox.event';
import { ArticleSearchMainAutocompleteProvider } from '../providers';
import { IconComponent } from '@shared/components/icon';
import { MatomoModule } from 'ngx-matomo-client';

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    RouterModule,
    DomainCatalogModule,
    UiCommonModule,
    UiIconModule,
    UiSelectBulletModule,
    UiSpinnerModule,
    OrderByFilterModule,
    ScrollingModule,
    UiTooltipModule,
    FilterModule,
    IconComponent,
    MatomoModule,
  ],
  exports: [ArticleSearchResultsComponent, SearchResultItemComponent],
  declarations: [
    ArticleSearchResultsComponent,
    SearchResultItemComponent,
    StockInfosPipe,
    SearchResultItemLoadingComponent,
    SearchResultSelectedPipe,
    AddedToCartModalComponent,
  ],
  providers: [
    FocusSearchboxEvent,
    {
      provide: FilterAutocompleteProvider,
      useClass: ArticleSearchMainAutocompleteProvider,
      multi: true,
    },
  ],
})
export class SearchResultsModule {}
