Renders one message of the chat modal's list, with its reply, edit and delete actions.
Renders a chat message, or the editor over its text while editing. Its
height eases between the two. Deleting asks for confirmation first.
Passed to ChatMessageItem by ChatModal for each message row. The
modal holds the edit, flash and permission state, and sends the edits and
deletions over the socket.
- canDelete: boolean
- canEdit: boolean
- editing: boolean
- flashed: boolean
-
grouped: boolean
Set when the message continues its author's run. It then has no avatar or author line: its time shows in the avatar's place on hover, and its actions float over its top.
-
mentionsMe: boolean
Highlights a message that @mentions the user,
@everyoneincluded, or replies to them. - message: ChatMessage
-
onDelete: (id: string) => void
Called once the user has confirmed.
-
onEdit: () => voidid: string,body: string
Called only when the text changed.
- onEndEdit: () => void
- onJumpTo: (id: string) => void
- onReply: (message: ChatMessage) => void
- onStartEdit: (id: string) => void
-
replyDeleted: boolean
Set when the replied-to message was deleted live, after the server filled in
replyToAuthor.
Usage
import * as mod from "src/components/chat/ChatMessageItem.tsx";