import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import { Probe, ProbeHost } from '@overflow/commons-typescript/model/probe';

@Component({
  selector: 'of-probe-summary',
  templateUrl: './probe-summary.component.html',
})
export class ProbeSummaryComponent implements OnChanges {

  @Input() probeHost: ProbeHost;
  connectionStatus: string;

  constructor() {
  }

  ngOnChanges(changes: SimpleChanges): void {
    this.connectionStatus = this.probeHost.probe.connectDate ? 'Connected' : 'Not connected';
  }
}

