import { Component, OnInit } from '@angular/core';
import { DetailsComponentBase } from '@objects-view/details-component-base';
import { IProductModel } from '@fleio-api/billing/model/product.model';
import { ProductsApiService } from '@fleio-api/billing/products/product-api.service';
import { ClipboardService } from '@shared/ui-api/clipboard.service';

@Component({
  selector: 'app-product-links',
  templateUrl: './product-links.component.html',
  styleUrls: ['./product-links.component.scss']
})
export class ProductLinksComponent extends DetailsComponentBase<IProductModel> implements OnInit {
  entries = null;

  constructor(
    private productsApiService: ProductsApiService,
    public clipboard: ClipboardService,
  ) {
    super();
  }

  ngOnInit(): void {
    super.ngOnInit();
    this.productsApiService.getLinks(this.object.id).subscribe(
      value => {
        this.entries = value;
      }
    );
  }

}
