import {Component, EventEmitter, Input, Output} from '@angular/core';

@Component({
  selector: 'pages-menu',
  templateUrl: 'pages-menu.component.html',
  styleUrls: ['pages-menu.component.scss']
})
export class PagesMenuComponent {
  @Input() items = <any>[];
  @Output() onSelected = new EventEmitter();
  public hidden = false;

  private hiddenPages = ['/o-tsentre/protivodeistvie-korruptsii', '/o-tsentre/zashchita-personalnykh-dannykh', '/o-tsentre/okhrana-truda'];



  get visibleItems() {
    return this.items.filter(item => {
      return this.hiddenPages.indexOf(item.link) === -1;
    });
  }


  close() {
    this.hidden = true;
    setTimeout(() => {this.hidden = false;}, 1);
  }

  itemSelect(event:any){
    this.onSelected.emit(event);
  }

}
