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

@Component({
    moduleId: module.id,
    templateUrl: './modal-view-editnote.component.html',
    styleUrls: ['./_modal-view-editnote.component.scss']
})
export class ModalViewEditnoteComponent implements OnInit {

    height: string = '50%';
    initialNote: string = '';

    @ViewChild('note', {static: true}) note: ElementRef;

    constructor(private _params: ModalDialogParams
    ) { }

    ngOnInit(): void {
        if (this._params.context.note) {
            this.initialNote = this._params.context.note;
        }
    }

    onClose(): void {
        this._params.closeCallback(this.note.nativeElement.text);
    }

    get icon() {
        return String.fromCharCode(0xf304);
    }
}
