import { Component, OnInit, Input, EventEmitter, Output } from "@angular/core";
import { Router } from '@angular/router';

@Component({
  selector: "sts-search-datatable",
  templateUrl: "./search-datatable.component.html",
  styleUrls: ["./search-datatable.component.scss"]
})
export class SearchDatatableComponent implements OnInit {
  @Input() items;
  @Output() public addQuotation: EventEmitter<any> = new EventEmitter();

  constructor(
    private router: Router
  ) {}

  ngOnInit() {}

  editRow() {}

  navigateToSummaryPage(id:string) {
    this.router.navigate(['/stocks/car/'+id]);
  }

  goToSummary(event) {
    this.router.navigate(['/stocks/car/'+event.commissionId]);
  }

  addCustomerQuotation(event) {
    this.addQuotation.emit(event);
  }
}
