import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { BreadcrumbService } from '@app/commons/service/breadcrumb.service';

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

  private index;

  constructor(
    private router: Router,
    private route: ActivatedRoute,
    private breadcrumbService: BreadcrumbService
  ) {
    breadcrumbService.setItems([
      { label: 'Probe', routerLink: ['/probe/list'] },
      { label: 'Download', routerLink: ['/probe/download'] },
    ]);
  }

  ngOnInit() {
    this.route.params.subscribe((params: any) => {
      this.index = params['idx'];
    });
  }

  onSelect(index) {
    this.router.navigate(['/probe/download', index]);
  }
}
