import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { Store, select } from '@ngrx/store';
import { Observable, of, Subscription } from 'rxjs';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';

import { AuthSelector } from '@overflow/shared/auth/store';
import { DomainMember } from '@overflow/commons-typescript/model/domain';
import { InfraHost } from '@overflow/commons-typescript/model/infra';

@Component({
  selector: 'of-probe-host',
  templateUrl: './probe-host.component.html',
})
export class ProbeHostComponent implements OnInit {

  @Input() infraHost: InfraHost;
  @Input() infraHostID: number;
  error$: Observable<any>;
  pending$: Observable<boolean>;

  constructor(
  ) {
  }

  ngOnInit() {
    if (undefined === this.infraHost && undefined === this.infraHostID) {
      // Create
    } else if (undefined !== this.infraHost && undefined === this.infraHostID) {
      // use infraHost
    } else if (undefined === this.infraHost && undefined !== this.infraHostID) {
      // get infraHost
    } else {
      // error
    }
  }

}