This component is data aware

Component

The ChatMessage component is a specific message, handling message related functions such as reactions, replies, copy message, etc.

API

Import

import { ChatMessage } from "@botstacks/chat-react";

Props

NameTypeDefaultDescription
message[IMessage](/sdk-reference/javascript/store#messageThe message to display
disableReactionsbooleanfalseDisable option to add reactions
disableAvatarbooleanfalseHide the user’s avatar
disableReplybooleanfalseDisable option to reply to a message
disableExtrasbooleanfalseHide the extra options of a message, such as copy, edit, delete
renderMessage(message: Message) => voidIf provided, use this function rather than the baked in UI
classNamesobject

Specific class names to override bubbles. Options are sender and bubble

onReply(message: Message) => void

If provided, show the option to reply to the message and handle callback

onEdit() => voidCallback for editing a message
onDelete(id: string) => voidCallback for deleting a message