discourse/plugins/chat/assets/javascripts/discourse/components/chat-channel-leave-btn.js
Roman Rizzi 0a5f548635
DEV: Move discourse-chat to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00

26 lines
700 B
JavaScript

import discourseComputed from "discourse-common/utils/decorators";
import Component from "@ember/component";
import { equal } from "@ember/object/computed";
import { inject as service } from "@ember/service";
import { CHATABLE_TYPES } from "discourse/plugins/chat/discourse/models/chat-channel";
export default Component.extend({
tagName: "",
channel: null,
chat: service(),
isDirectMessageRow: equal(
"channel.chatable_type",
CHATABLE_TYPES.directMessageChannel
),
@discourseComputed("isDirectMessageRow")
leaveChatTitleKey(isDirectMessageRow) {
if (isDirectMessageRow) {
return "chat.direct_messages.leave";
} else {
return "chat.leave";
}
},
});