2024-05-23 15:17:28 +00:00
|
|
|
// SPDX-FileCopyrightText: 2024 Mehdi Benadel <https://mehdibenadel.com>
|
2024-06-12 16:51:04 +00:00
|
|
|
// SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
|
2024-05-23 15:17:28 +00:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-09-09 16:47:21 +00:00
|
|
|
// FIXME: @stylistic/indent is buggy with strings literrals.
|
|
|
|
/* eslint-disable @stylistic/indent */
|
|
|
|
|
2024-06-12 16:51:04 +00:00
|
|
|
import { ptTr } from '../directives/translation'
|
2024-05-23 15:09:58 +00:00
|
|
|
import { html } from 'lit'
|
2024-05-23 13:52:12 +00:00
|
|
|
import { customElement, property } from 'lit/decorators.js'
|
2024-05-25 12:40:59 +00:00
|
|
|
import { LivechatElement } from './livechat'
|
2024-05-23 13:52:12 +00:00
|
|
|
|
2024-06-12 13:50:14 +00:00
|
|
|
@customElement('livechat-configuration-section-header')
|
2024-06-12 15:08:48 +00:00
|
|
|
export class ConfigurationSectionHeaderElement extends LivechatElement {
|
2024-05-23 13:52:12 +00:00
|
|
|
@property({ attribute: false })
|
2024-06-12 16:51:04 +00:00
|
|
|
public label: string | ReturnType<typeof ptTr> = '???'
|
2024-05-23 13:52:12 +00:00
|
|
|
|
|
|
|
@property({ attribute: false })
|
2024-06-12 16:51:04 +00:00
|
|
|
public description?: string | ReturnType<typeof ptTr>
|
2024-05-23 13:52:12 +00:00
|
|
|
|
|
|
|
@property({ attribute: false })
|
2024-06-12 16:51:04 +00:00
|
|
|
public helpPage?: string
|
2024-05-23 13:52:12 +00:00
|
|
|
|
2024-05-23 20:52:39 +00:00
|
|
|
protected override render = (): unknown => {
|
2024-05-23 13:52:12 +00:00
|
|
|
return html`
|
2024-06-12 08:27:28 +00:00
|
|
|
<h2>
|
2024-06-12 16:51:04 +00:00
|
|
|
${this.label}
|
|
|
|
${
|
|
|
|
this.helpPage === undefined
|
|
|
|
? ''
|
|
|
|
: html`<livechat-help-button .page=${this.helpPage}></livechat-help-button>`
|
|
|
|
}
|
2024-06-12 08:27:28 +00:00
|
|
|
</h2>
|
2024-06-12 16:51:04 +00:00
|
|
|
${
|
|
|
|
this.description === undefined
|
|
|
|
? ''
|
|
|
|
: html`<p>${this.description}</p>`
|
|
|
|
}`
|
2024-05-23 13:52:12 +00:00
|
|
|
}
|
|
|
|
}
|