import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
import { Router } from '@angular/router';
import { ProductsFeed } from '@domain/isa';

@Component({
  selector: 'page-products-card',
  templateUrl: 'product-card.component.html',
  styleUrls: ['product-card.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ProductsCardComponent {
  @Input()
  feed: ProductsFeed;

  constructor(private _router: Router) {}

  navigatetToProduct(ean: string) {
    this._router.navigate(['/kunde/product/details/ean', ean]);
  }
}
