import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Router } from '@angular/router';
import { ApplicationService } from '@core/application';
import { UiModalRef } from '@ui/modal';

@Component({
  selector: 'added-to-cart-modal',
  templateUrl: 'added-to-cart-modal.component.html',
  styleUrls: ['added-to-cart-modal.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AddedToCartModalComponent {
  constructor(
    public ref: UiModalRef<any, any>,
    private readonly _router: Router,
    private readonly _applicationService: ApplicationService
  ) {}
  continue() {
    this._router.navigate([`/kunde/${this._applicationService.activatedProcessId}/product/search`]);
    this.ref.close();
  }

  toCart() {
    this._router.navigate([`/kunde/${this._applicationService.activatedProcessId}/cart/review`]);
    this.ref.close();
  }
}
