mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
Enables our new eslint rules which enforce consistent i18n imports. For more info, see https://github.com/discourse/lint-configs/commit/0d58b40cd7d170a9f70bcef5c173f95eeb498298
36 lines
954 B
Plaintext
36 lines
954 B
Plaintext
import Component from "@glimmer/component";
|
|
import { htmlSafe } from "@ember/template";
|
|
import { i18n } from "discourse-i18n";
|
|
import { isCollapsible } from "discourse/plugins/chat/discourse/components/chat-message-collapser";
|
|
import ChatMessageCollapser from "./chat-message-collapser";
|
|
|
|
export default class ChatMessageText extends Component {
|
|
get isEdited() {
|
|
return this.args.edited ?? false;
|
|
}
|
|
|
|
get isCollapsible() {
|
|
return isCollapsible(this.args.cooked, this.args.uploads);
|
|
}
|
|
|
|
<template>
|
|
<div class="chat-message-text">
|
|
{{#if this.isCollapsible}}
|
|
<ChatMessageCollapser
|
|
@cooked={{@cooked}}
|
|
@uploads={{@uploads}}
|
|
@onToggleCollapse={{@onToggleCollapse}}
|
|
/>
|
|
{{else}}
|
|
{{htmlSafe @cooked}}
|
|
{{/if}}
|
|
|
|
{{#if this.isEdited}}
|
|
<span class="chat-message-edited">({{i18n "chat.edited"}})</span>
|
|
{{/if}}
|
|
|
|
{{yield}}
|
|
</div>
|
|
</template>
|
|
}
|