import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import {TooltipPosition} from '@angular/material';
import { LocalStorageService } from 'angular-2-local-storage';

@Component({
  selector: 'app-employee-project-list',
  templateUrl: './employee-project-list.component.html',
  styleUrls: ['./employee-project-list.component.scss']
})

export class EmployeeProjectListComponent implements OnInit {
  projectRepoInfo;
  projectInfo: any;
  listTableHeader: string[];
  position: TooltipPosition[] = ['left', 'right'];
  currentUser;
  @Output() viewPrjDetail = new EventEmitter();
  constructor( protected localStorageService: LocalStorageService) {
    this.currentUser = this.localStorageService.get('userInfo');
  }
  @Input() myProjects;
  @Input() invites;
  @Input() allProjects;
  @Input() projectDetailsInfo;
  ngOnInit() {
    const listH = ['Projects', 'Owner', 'Created on', 'Members', 'Environment Status'];
    if (this.myProjects) {
      listH.unshift('Your Role');
    }
    this.listTableHeader = listH;
  }

  showDetails(val, project) {
    this.viewPrjDetail.emit({val: val, project: project});
  }
}
