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

@Component({
  selector: 'app-sandboxtile',
  templateUrl: './sandboxtile.component.html',
  styleUrls: ['./sandboxtile.component.scss']
})
export class SandboxtileComponent implements OnInit {

  @Input() tileData: any;
  othIcons : boolean = false;

  @Output() sbEditEvent = new EventEmitter<any>();
  @Output() sbDeleteEvent = new EventEmitter();

  @Input() skillTrackDet: any;
  
  constructor() { }

  ngOnInit() {
  }
  Initials(xitem: string) {
    if (xitem) {
      return xitem.replace(/\W*(\w)\w*/g, '$1').toUpperCase();
    }
  }
  showOtherIcons(id){
    this.othIcons = true;
    // console.log("menu icon clicked --- "+id);
  }

  editSandbox(id, tileData){
    // console.log(id);
    this.sbEditEvent.emit(tileData);
    // console.log('Edit sb details --- ' +JSON.stringify(tileData));
  }

  deleteSandbox(id, tileData){
    // console.log(id);
    this.sbDeleteEvent.emit(id);
    // console.log('Delete sb details --- ' +JSON.stringify(tileData));
  }

}
