import { html } from "lit-html"; import { __ } from '@converse/headless/i18n'; const i18n_moderator_hint = __('This user is a moderator.'); const i18n_participant_hint = __('This user can send messages in this groupchat.'); const i18n_visitor_hint = __('This user can NOT send messages in this groupchat.') const i18n_owner = __('Owner'); const i18n_admin = __('Admin'); const i18n_member = __('Member'); const i18n_moderator = __('Moderator'); const i18n_visitor = __('Visitor'); const occupant_title = (o) => { if (o.role === "moderator") { return `${o.jid} ${i18n_moderator_hint} ${o.hint_occupant}`; } else if (o.role === "participant") { return `${o.jid} ${i18n_participant_hint} ${o.hint_occupant}`; } else if (o.role === "visitor") { return `${o.jid} ${i18n_visitor_hint} ${o.hint_occupant}`; } else if (!["visitor", "participant", "moderator"].includes(o.role)) { return `${o.jid} ${o.hint_occupant}`; } } export default (o) => html`
  • ${o.nick || o.jid} ${ (o.affiliation === "owner") ? html`${i18n_owner}` : '' } ${ (o.affiliation === "admin") ? html`${i18n_admin}` : '' } ${ (o.affiliation === "member") ? html`${i18n_member}` : '' } ${ (o.role === "moderator") ? html`${i18n_moderator}` : '' } ${ (o.role === "visitor") ? html`${i18n_visitor}` : '' }
  • `;