import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { EquipmentDetails } from 'src/app/interfaces/equipment-management.interface';

@Component({
  selector: 'app-equipment-maintenance-plains',
  templateUrl: './equipment-maintenance-plains.component.html',
  styleUrls: ['./equipment-maintenance-plains.component.css']
})
export class EquipmentMaintenancePlainsComponent implements OnInit {
  isLoading: boolean;
  hasError: boolean;
  errorStr: string;

  equipment: EquipmentDetails | null;

  constructor(
    @Inject(MAT_DIALOG_DATA) private _data: any
  ) {
    this.isLoading = true;
    this.hasError = false;
    this.errorStr = '';
    
    this.equipment = null;
  }

  ngOnInit(): void {
    this.equipment = this._data.equipment;
    console.log(this.equipment);
  }
}
