import {
  Component,
  OnInit,
  OnDestroy,
  Output,
  EventEmitter,
  ChangeDetectionStrategy
} from '@angular/core';

import { LogService } from '@ucap/ng-logger';
import { I18nService } from '@ucap/ng-i18n';

@Component({
  selector: 'app-sections-group-search',
  templateUrl: './search.section.component.html',
  styleUrls: ['./search.section.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class SearchSectionComponent implements OnInit, OnDestroy {
  @Output()
  keyDownEnter = new EventEmitter<{
    companyCode: string;
    searchWord: string;
  }>();

  @Output()
  searchCancel = new EventEmitter<any>();

  constructor(
    private logService: LogService,
    private i18nService: I18nService
  ) {}

  ngOnInit(): void {}

  ngOnDestroy(): void {}

  onKeyDownEnter(params: { companyCode: string; searchWord: string }) {
    this.keyDownEnter.emit(params);
  }
  onClickCancel() {
    this.searchCancel.emit();
  }
}
