import { __ } from 'i18n' import { _converse, api } from '@converse/headless/core' import { html } from 'lit' import tplMucBottomPanel from '../../src/plugins/muc-views/templates/muc-bottom-panel.js' async function setNickname (ev, model) { ev.preventDefault() const nick = ev.target.nick.value.trim() nick && await model.setNickname(nick) _converse.api.trigger('livechatViewerModeSetNickname') } export default (o) => { if (api.settings.get('livechat_viewer_mode')) { const model = o.model const i18nNickname = __('Nickname') const i18nJoin = __('Enter groupchat') return html`
setNickname(ev, model)}>
${tplMucBottomPanel(o)}` } return tplMucBottomPanel(o) }