import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { EmployeeProjectInviteComponent } from '../employee-project-invite/employee-project-invite.component';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';
import {TooltipPosition} from '@angular/material';
import { environment } from '../../../../environments/environment.dev';
import { LocalStorageService } from 'angular-2-local-storage';

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

export class EmployeeProjectTileComponent implements OnInit {
  projectRepoInfo: any;
  projectInfo;
  img_path: string;
  tiles;
  position: TooltipPosition[] = ['above'];
  currentUser;
  @Input() myProjects;
  @Input() invites;
  @Input() allProjects;
  @Input() projectDetailsInfo;
  @Output() viewPrjDetail = new EventEmitter();

  constructor(private dialog: MatDialog, protected localStorageService: LocalStorageService) {
    this.img_path = environment.imageUrl + '/assets/img/employee/newdashboard/';
    this.currentUser = this.localStorageService.get('userInfo');
   }

  ngOnInit() {

  }
  openInviteDialog(project) {
    const dialogRef = this.dialog.open(EmployeeProjectInviteComponent, {
      height: '390px',
      width: '740px',
      data: project
    });
  }
  showDetails(val, project) {
    this.viewPrjDetail.emit({val: val, project: project});
  }

}
