import { Component, OnInit } from '@angular/core';
import { ModalDialogParams } from '@nativescript/angular';

@Component({
    moduleId: module.id,
    templateUrl: './modal-view-help.component.html',
    styleUrls: ['./modal-view-help.component.scss']
})
export class ModalHelpComponent implements OnInit {
    label: string;
    messages: string[];

    constructor(private _params: ModalDialogParams
    ) { }

    ngOnInit(): void {
        if (this._params.context.label) {
            this.label = this._params.context.label;
        }
        if (this._params.context.messages) {
            this.messages = this._params.context.messages;
        }
    }

    templateSelector(item: any, index: number, items: any): string {
        return 'default';
    }

    onClose(): void {
        this._params.closeCallback(null);
    }

    get helpIcon() {
        return String.fromCharCode(0xf059);
    }
}
