import CollapsibleWidget from "./collapsible_widget.js";
const TPL = `
`;
export default class NoteInfoWidget extends CollapsibleWidget {
    getWidgetTitle() { return "Note info"; }
    async doRenderBody() {
        this.$body.html(TPL);
        this.$noteId = this.$body.find(".note-info-note-id");
        this.$dateCreated = this.$body.find(".note-info-date-created");
        this.$dateModified = this.$body.find(".note-info-date-modified");
        this.$type = this.$body.find(".note-info-type");
        this.$mime = this.$body.find(".note-info-mime");
    }
    async refreshWithNote(note) {
        const noteComplement = await this.tabContext.getNoteComplement();
        this.$noteId.text(note.noteId);
        this.$dateCreated
            .text(noteComplement.dateCreated)
            .attr("title", noteComplement.dateCreated);
        this.$dateModified
            .text(noteComplement.dateModified)
            .attr("title", noteComplement.dateCreated);
        this.$type.text(note.type);
        this.$mime
            .text(note.mime)
            .attr("title", note.mime);
    }
    entitiesReloadedEvent({loadResults}) {
        if (loadResults.isNoteReloaded(this.noteId)) {
            this.refresh();
        }
    }
}