// SPDX-FileCopyrightText: 2024 John Livingston // // SPDX-License-Identifier: AGPL-3.0-only // FIXME: @stylistic/indent is buggy with strings literrals. /* eslint-disable @stylistic/indent */ import { api } from '@converse/headless' import { html } from 'lit' import { __ } from 'i18n' export function tplMucNote (el, note) { // eslint-disable-next-line no-undef const i18nDelete = __(LOC_moderator_note_delete) // eslint-disable-next-line no-undef const i18nSearch = __(LOC_moderator_note_search_for_participant) const aboutOccupant = note.getAboutOccupant() return !el.edit ? html`
${ aboutOccupant ? html` ` : '' }
${note.get('description') ?? ''}
${ aboutOccupant && el.is_ocupant_filter ? '' : html` ` }
` : html`
${ aboutOccupant ? html` ` : '' } ${_tplNoteForm(note)}
` } function _tplNoteForm (note) { // eslint-disable-next-line no-undef const i18nNoteDesc = __(LOC_moderator_note_description) return html`
` } function _tplNoteOccupantFormFields (occupant) { if (!occupant) { return '' } return html` ` } export function tplMucCreateNoteForm (notesEl, occupant) { const i18nOk = __('Ok') const i18nCancel = __('Cancel') return html`
${ occupant ? html` ${_tplNoteOccupantFormFields(occupant)} ` : '' } ${_tplNoteForm(undefined)}
${!notesEl.create_note_error_message ? '' : html`
${notesEl.create_note_error_message}
` }
` }