import Utils from "./utils.js"; /** * Component to render data for not conserved assets * @class NotConserved */ export class NotConserved { biblioElements = []; /** * @param {object} data */ set data(data) { this._data = data; } async render() { return `
Denominazione: ${this._data.denomination}
Periodo: ${this._data.period}
Località generica: ${this._data.genericLocation}
Descrizione ${this._data.shortDescription}
Bibliografia: ${await this.biblio(this._data.id)}
Autore scheda: ${this._data.author}
Nessuna risorsa visuale disponibile
'; } async renderDocs() { return await Utils.generateDocsTable(this._data, 'not_conserved'); } async biblio(recordId) { let {citations, biblioElements} = await Utils.buildBibliography('not_conserved', recordId); this.biblioElements = biblioElements; return citations; } getReference(id) { return this.biblioElements.find(ref => { let regex = new RegExp('ref-'+id+'"'); return ref.match(regex); }); } }