import { Component, OnDestroy } from '@angular/core';
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import { Subscription } from 'rxjs/Subscription';
import { Probe } from '@overflow/commons-typescript/model/probe';
import { Target } from '@overflow/commons-typescript/model/target';

@Component({
  selector: 'of-pages-probe',
  templateUrl: './probe-page.component.html',
})
export class ProbePageComponent {

  private isDetail: boolean;

  constructor(
    private router: Router,
    private route: ActivatedRoute
  ) {
    this.route.params.subscribe(params => {
      this.isDetail = params['id'] ? true : false;
    });
  }

  onProbeSelect(probe: Probe) {
    this.router.navigate(['probe', probe.id, 'info']);
  }

  onTargetSelect(target: Target) {
    console.log(target);
  }
}
