Fix lit linting, WIP.

This commit is contained in:
John Livingston
2024-06-12 18:51:04 +02:00
parent be93f26fb1
commit d4692c81e0
3 changed files with 32 additions and 17 deletions

View File

@ -1,7 +1,9 @@
// SPDX-FileCopyrightText: 2024 Mehdi Benadel <https://mehdibenadel.com>
// SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
//
// SPDX-License-Identifier: AGPL-3.0-only
import { ptTr } from '../directives/translation'
import { html } from 'lit'
import { customElement, property } from 'lit/decorators.js'
import { LivechatElement } from './livechat'
@ -9,21 +11,28 @@ import { LivechatElement } from './livechat'
@customElement('livechat-configuration-section-header')
export class ConfigurationSectionHeaderElement extends LivechatElement {
@property({ attribute: false })
public override title: string = 'title'
public label: string | ReturnType<typeof ptTr> = '???'
@property({ attribute: false })
public description: string = 'Here\'s a description'
public description?: string | ReturnType<typeof ptTr>
@property({ attribute: false })
public helpPage: string = 'documentation'
public helpPage?: string
protected override render = (): unknown => {
return html`
<h2>
${this.title}
<livechat-help-button .page=${this.helpPage}></livechat-help-button>
${this.label}
${
this.helpPage === undefined
? ''
: html`<livechat-help-button .page=${this.helpPage}></livechat-help-button>`
}
</h2>
<p>${this.description}</p>
`
${
this.description === undefined
? ''
: html`<p>${this.description}</p>`
}`
}
}