import { Component, OnInit } from '@angular/core';
import { DetailsComponentBase } from '@objects-view/details-component-base';
import { FormatHelper } from '@shared/ui-api/helpers/format-helper';
import { ConfigService } from '@shared/config/config.service';
import { ILBHealthMonitorModel } from '@fleio-api/openstack/load-balancing/model/lb-health-monitor.model';

@Component({
  selector: 'app-healthmonitor-details-overview',
  templateUrl: './healthmonitor-details-overview.component.html',
  styleUrls: ['./healthmonitor-details-overview.component.scss']
})
export class HealthmonitorDetailsOverviewComponent extends DetailsComponentBase<ILBHealthMonitorModel> implements OnInit {
  formatHelper = new FormatHelper();

  constructor(
    public config: ConfigService,
  ) {
    super();
  }

  ngOnInit() {
    super.ngOnInit();
    if (this.object && this.object.id) {
      this.object.admin_state_up_display = this.object.admin_state_up ? $localize`Yes` : $localize`No`;
      this.object.operating_status = this.object.operating_status || $localize`n/a`;
      this.object.provisioning_status = this.object.provisioning_status || $localize`n/a`;
    }
  }
}
