2024-06-07 09:51:32 +00:00
|
|
|
// SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { LivechatElement } from '../../lib/elements/livechat'
|
|
|
|
import { ptTr } from '../../lib/directives/translation'
|
|
|
|
import { html, TemplateResult } from 'lit'
|
|
|
|
import { customElement, property } from 'lit/decorators.js'
|
2024-06-14 08:45:36 +00:00
|
|
|
import { classMap } from 'lit/directives/class-map.js'
|
2024-06-07 09:51:32 +00:00
|
|
|
|
|
|
|
@customElement('livechat-channel-tabs')
|
|
|
|
export class ChannelHomeElement extends LivechatElement {
|
|
|
|
@property({ attribute: false })
|
|
|
|
public channelId?: number
|
|
|
|
|
|
|
|
@property({ attribute: false })
|
|
|
|
public active?: string
|
|
|
|
|
|
|
|
protected override render = (): TemplateResult => {
|
|
|
|
return html`
|
|
|
|
<a
|
2024-06-14 08:45:36 +00:00
|
|
|
class=${classMap({
|
|
|
|
'sub-menu-entry': true,
|
|
|
|
active: this.active === 'configuration'
|
|
|
|
})}
|
2024-06-07 09:51:32 +00:00
|
|
|
href=${'/p/livechat/configuration/channel?channelId=' + encodeURIComponent(this.channelId ?? '')}
|
|
|
|
>
|
|
|
|
${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_TITLE)}
|
|
|
|
</a>
|
|
|
|
<a
|
2024-06-14 08:45:36 +00:00
|
|
|
class=${classMap({
|
|
|
|
'sub-menu-entry': true,
|
|
|
|
active: this.active === 'emojis'
|
|
|
|
})}
|
2024-06-07 09:51:32 +00:00
|
|
|
href=${'/p/livechat/configuration/emojis?channelId=' + encodeURIComponent(this.channelId ?? '')}
|
|
|
|
>
|
|
|
|
${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_EMOJIS_TITLE)}
|
|
|
|
</a>
|
|
|
|
`
|
|
|
|
}
|
|
|
|
}
|