import { html } from "lit-html"; import { __ } from '@converse/headless/i18n'; import { until } from 'lit-html/directives/until.js'; import avatar from "./avatar.js"; const i18n_profile = __('The User\'s Profile Image'); const avatar_data = { 'alt_text': i18n_profile, 'extra_classes': '', 'height': 40, 'width': 40, } const tpl_standalone_btns = (o) => o.standalone_btns.reverse().map(b => until(b, '')); export default (o) => { return html`
${ (!o._converse.api.settings.get("singleton")) ? html`
` : '' } ${ (o.type !== o._converse.HEADLINES_TYPE) ? avatar(Object.assign({}, o, avatar_data)) : '' }
${ o.url ? html`${o.display_name}` : o.display_name}
${ o.dropdown_btns.length ? html`` : '' } ${ o.standalone_btns.length ? tpl_standalone_btns(o) : '' }
${ o.status ? html`

${ o.status }

` : '' } `; }