import {
  Component,
  OnInit,
  Input,
  Output,
  EventEmitter,
  ChangeDetectorRef
} from '@angular/core';
import { ucapAnimations } from '../animations';

@Component({
  selector: 'ucap-integrated-search-form',
  templateUrl: './integrated-search-form.component.html',
  styleUrls: ['./integrated-search-form.component.scss'],
  animations: ucapAnimations
})
export class IntegratedSearchFormComponent implements OnInit {
  @Input()
  searchWord?: string;

  @Output()
  search = new EventEmitter<string>();

  constructor(private changeDetectorRef: ChangeDetectorRef) {}

  ngOnInit() {}

  onKeyDownEnter(keyword: string) {
    this.search.emit(keyword);
  }
}
