import { Component, EventEmitter, Output } from '@angular/core';
import { ApplicationService } from '@core/application';
import { ArticleDetailsStore } from '../article-details.store';
import { ProductCatalogNavigationService } from '@shared/services/navigation';

@Component({
  selector: 'page-article-recommendations',
  templateUrl: 'article-recommendations.component.html',
  styleUrls: ['article-recommendations.component.scss'],
  standalone: false,
})
export class ArticleRecommendationsComponent {
  @Output()
  close = new EventEmitter<void>();

  constructor(
    public readonly store: ArticleDetailsStore,
    private readonly _applicationService: ApplicationService,
    private readonly _navigationService: ProductCatalogNavigationService,
  ) {}

  getDetailsPath(ean?: string) {
    return this._navigationService.getArticleDetailsPathByEan({
      processId: this._applicationService.activatedProcessId,
      ean,
    }).path;
  }
}
