Source: viewer/loader/Authors.js

import { UiElement } from "../../ui/UiElement.js";

/**
 * A function that creates an element for the basic ProjectDescription
 * 
 * @memberof vef.viewer.loader
 * 
 * @param {object} options 
 * @param {Viewer} viewer 
 */
export function Authors(options, viewer) {
    const element = new UiElement();

    let html = "";
    for (let author of options.authors) {
        html += `
            <b style='font-size: 16px;'>${author?.name || ""}</b>
            <p style="font-size: 13px;">
                ${author?.position || ""}<br/>
                <b>${author?.organisation || ""}</b><br/>
                ${author?.address || ""}<br/>
                ${author?.postCode || ""} ${author?.city || ""} ${author?.stateOrProvince || ""} ${author?.country || ""}<br/>
        `;

        if (author?.phone?.length) html += `<b style="width:50px; display: inline-block;">Tel.:</b>${author.phone}<br/>`;
        if (author?.fax?.length) html += `<b style="width:50px; display: inline-block;">Fax.:</b>${author.fax}<br/>`;
        if (author?.orcid?.length) html += `<b style="width:50px; display: inline-block;">ORCID:</b><a target="_blank" href="${author.orcid}">${author.orcid}</a><br/>`;
        if (author?.email?.length) html += `<b style="width:50px; display: inline-block;">E-Mail:</b><a href="mailto:${author.email}">${author.email}</a><br/>`;
        html += "</p>"
    }

    element.getElement().innerHTML = html;
    viewer.addElement(options.id, element);
}