import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { SortOption } from '../../../../../core/search/models/search.model';
import { TranslatePipe } from '../../../../../i18n/translate.pipe';

@Component({
  selector: 'app-catalog-sorting-control',
  standalone: true,
  imports: [FormsModule, TranslatePipe],
  templateUrl: './sorting-control.component.html',
  styleUrls: ['./sorting-control.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class CatalogSortingControlComponent {
  @Input() options: SortOption[] = [];
  @Input() selected = 'relevance';

  @Output() selectedChange = new EventEmitter<string>();
}
