peertube-plugin-livechat/client/common/configuration/elements/channel-tabs.ts

42 lines
1.3 KiB
TypeScript
Raw Normal View History

// 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'
@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'
})}
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'
})}
href=${'/p/livechat/configuration/emojis?channelId=' + encodeURIComponent(this.channelId ?? '')}
>
${ptTr(LOC_LIVECHAT_CONFIGURATION_CHANNEL_EMOJIS_TITLE)}
</a>
`
}
}