import { Component, OnInit, Input, ViewChild, ElementRef } from '@angular/core';
import { OverlayPanel } from 'primeng/overlaypanel';

@Component({
    selector: 'icon-tooltip',
    templateUrl: './icon-tooltip.component.html',
})
export class IconTooltipComponent implements OnInit {
    name: string;
    content: string;
    routerLink: string;

    @ViewChild('op')
    panel: OverlayPanel;

    constructor() {}

    ngOnInit(): void {}

    overlayPanelShow($event) {}

    show(event: MouseEvent, data: ToolTipData) {
        this.name = data.name;
        this.content = data.content;
        this.routerLink = data.routerLink;
        this.panel.toggle(event, event.currentTarget);
    }

    hide() {
        this.panel.hide();
    }
}

export class ToolTipData {
    name: string;
    content: string;
    routerLink: string;
}
