import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { TranslatePipe } from '../../../../../i18n/translate.pipe';

export interface ProductActionsConfig {
  addToCart: boolean;
  buyNow: boolean;
  wishlist: boolean;
  compare: boolean;
  share: boolean;
  notifyMe: boolean;
}

@Component({
  selector: 'app-product-actions',
  standalone: true,
  imports: [TranslatePipe],
  templateUrl: './product-actions.component.html',
  styleUrls: ['./product-actions.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ProductActionsComponent {
  @Input() config: ProductActionsConfig = {
    addToCart: true,
    buyNow: true,
    wishlist: true,
    compare: true,
    share: true,
    notifyMe: true,
  };

  @Input() outOfStock = false;
  @Input() inWishlist = false;
  @Input() inCompare = false;

  @Output() addToCart = new EventEmitter<void>();
  @Output() buyNow = new EventEmitter<void>();
  @Output() wishlist = new EventEmitter<void>();
  @Output() compare = new EventEmitter<void>();
  @Output() share = new EventEmitter<void>();
  @Output() notifyMe = new EventEmitter<void>();
}
