import { DecimalPipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { Product } from '../../../../../core/products/models/product-domain.model';
import { TranslatePipe } from '../../../../../i18n/translate.pipe';

@Component({
  selector: 'app-product-delivery-information',
  standalone: true,
  imports: [DecimalPipe, TranslatePipe],
  templateUrl: './delivery-information.component.html',
  styleUrls: ['./delivery-information.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ProductDeliveryInformationComponent {
  @Input({ required: true }) product!: Product;
  @Input() currency = '';

  get hasDeliveryInfo(): boolean {
    return this.product.deliveryMode === 'digital' || !!this.product.deliveryOptions?.length;
  }
}
