import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { HistoryOrder } from 'src/app/interfaces/acquisition-management/order.interface';
import { SliderData } from 'src/app/interfaces/slider.interface';

@Component({
  selector: 'app-details-state-order',
  templateUrl: './details-state-order.component.html',
  styleUrls: ['./details-state-order.component.css']
})
export class DetailsStateOrderComponent implements OnInit {

  public arrImages: Array<SliderData>;
  public isLoadingForm: boolean;
  constructor(
    @Inject(MAT_DIALOG_DATA) public dataElement: HistoryOrder,
  ) {
    this.isLoadingForm = false;
    this.arrImages = [];
  }

  ngOnInit(): void {
    this.isLoadingForm = true;
    if (this.dataElement.HIOR_EVID !== null) {
      this.dataElement.HIOR_EVID.map((url:string) => {
        this.arrImages.push({image: `${url}`,})
      });
    }
    this.isLoadingForm = false;
  }

}
