Files
discourse/plugins/chat/assets/javascripts/discourse/components/chat-channel-leave-btn.gjs
Kris a914d3230b DEV: remap all core icons for fontawesome 6 upgrade (#28715)
Followup to 7d8974d02f7360b324b446868463e950fe92883f

Co-authored-by: David Taylor <david@taylorhq.com>
2024-09-13 16:50:52 +01:00

33 lines
789 B
Plaintext

import Component from "@glimmer/component";
import { service } from "@ember/service";
import { isPresent } from "@ember/utils";
import DButton from "discourse/components/d-button";
export default class ChatChannelLeaveBtn extends Component {
@service chat;
@service site;
get shouldRender() {
return this.site.desktopView && isPresent(this.args.channel);
}
get leaveChatTitleKey() {
if (this.args.channel.isDirectMessageChannel) {
return "chat.direct_messages.leave";
} else {
return "chat.leave";
}
}
<template>
{{#if this.shouldRender}}
<DButton
@icon="xmark"
@action={{@onLeaveChannel}}
@title={{this.leaveChatTitleKey}}
class="btn-flat chat-channel-leave-btn"
/>
{{/if}}
</template>
}