MessageItem

fun MessageItem(    messageItem: MessageItemState,     reactionSorting: ReactionSorting,     onLongItemClick: (Message) -> Unit,     modifier: Modifier = Modifier,     messageContentFactory: MessageContentFactory = ChatTheme.messageContentFactory,     onReactionsClick: (Message) -> Unit = {},     onThreadClick: (Message) -> Unit = {},     onPollUpdated: (Message, Poll) -> Unit = { _, _ -> },     onCastVote: (Message, Poll, Option) -> Unit = { _, _, _ -> },     onRemoveVote: (Message, Poll, Vote) -> Unit = { _, _, _ -> },     selectPoll: (Message, Poll, PollSelectionType) -> Unit = { _, _, _ -> },     onAddAnswer: (message: Message, poll: Poll, answer: String) -> Unit = { _, _, _ -> },     onClosePoll: (String) -> Unit = {},     onAddPollOption: (poll: Poll, option: String) -> Unit = { _, _ -> },     onGiphyActionClick: (GiphyAction) -> Unit = {},     onQuotedMessageClick: (Message) -> Unit = {},     onUserAvatarClick: () -> Unit? = null,     onLinkClick: (Message, String) -> Unit? = null,     onUserMentionClick: (User) -> Unit = {},     onReply: (Message) -> Unit = {},     onMediaGalleryPreviewResult: (MediaGalleryPreviewResult?) -> Unit = {},     leadingContent: @Composable RowScope.(MessageItemState) -> Unit = { with(ChatTheme.componentFactory) { MessageItemLeadingContent( messageItem = messageItem, onUserAvatarClick = onUserAvatarClick, ) } },     headerContent: @Composable ColumnScope.(MessageItemState) -> Unit = { with(ChatTheme.componentFactory) { MessageItemHeaderContent( messageItem = messageItem, reactionSorting = reactionSorting, onReactionsClick = onReactionsClick, ) } },     centerContent: @Composable ColumnScope.(MessageItemState) -> Unit = { if (messageContentFactory == MessageContentFactory.Deprecated) { with(ChatTheme.componentFactory) { MessageItemCenterContent( messageItem = messageItem, onLongItemClick = onLongItemClick, onMediaGalleryPreviewResult = onMediaGalleryPreviewResult, onGiphyActionClick = onGiphyActionClick, onQuotedMessageClick = onQuotedMessageClick, onLinkClick = onLinkClick, onUserMentionClick = onUserMentionClick, onPollUpdated = onPollUpdated, onCastVote = onCastVote, onRemoveVote = onRemoveVote, selectPoll = selectPoll, onAddAnswer = onAddAnswer, onClosePoll = onClosePoll, onAddPollOption = onAddPollOption, ) } } else { DefaultMessageItemCenterContent( messageItem = messageItem, onLongItemClick = onLongItemClick, messageContentFactory = messageContentFactory, onMediaGalleryPreviewResult = onMediaGalleryPreviewResult, onGiphyActionClick = onGiphyActionClick, onQuotedMessageClick = onQuotedMessageClick, onLinkClick = onLinkClick, onUserMentionClick = onUserMentionClick, onPollUpdated = onPollUpdated, onCastVote = onCastVote, onRemoveVote = onRemoveVote, selectPoll = selectPoll, onAddAnswer = onAddAnswer, onClosePoll = onClosePoll, onAddPollOption = onAddPollOption, ) } },     footerContent: @Composable ColumnScope.(MessageItemState) -> Unit = { with(ChatTheme.componentFactory) { MessageItemFooterContent( messageItem = messageItem, ) } },     trailingContent: @Composable RowScope.(MessageItemState) -> Unit = { with(ChatTheme.componentFactory) { MessageItemTrailingContent( messageItem = messageItem, ) } },     swipeToReplyContent: @Composable RowScope.() -> Unit = { with(ChatTheme.componentFactory) { SwipeToReplyContent() } })

The default message container for all messages in the Conversation/Messages screen.

It shows the avatar and the message details, which can have a header (reactions), the content which can be a text message, file or image attachment, or a custom attachment and the footer, which can be a deleted message footer (if we own the message) or the default footer, which contains a timestamp or the thread information.

It also allows for long click and thread click events.

Parameters

messageItem

The message item to show, which holds the message and the group position, if the message is in a group of messages from the same user.

reactionSorting

The sorting for the reactions, if we have any.

onLongItemClick

Handler when the user selects a message, on long tap.

modifier

Modifier for styling.

onReactionsClick

Handler when the user taps on message reactions.

onThreadClick

Handler for thread clicks, if this message has a thread going.

onCastVote

Handler for casting a vote on an option.

onRemoveVote

Handler for removing a vote on an option.

selectPoll

Handler for selecting a poll.

onAddAnswer

Handler for adding an answer to a poll.

onClosePoll

Handler for closing a poll.

onAddPollOption

Handler for adding a poll option.

onGiphyActionClick

Handler when the user taps on an action button in a giphy message item.

onQuotedMessageClick

Handler for quoted message click action.

onUserAvatarClick

Handler when users avatar is clicked.

onLinkClick

Handler for clicking on a link in the message.

onMediaGalleryPreviewResult

Handler when the user selects an option in the Media Gallery Preview screen.

leadingContent

The content shown at the start of a message list item.

headerContent

The content shown at the top of a message list item.

centerContent

The content shown at the center of a message list item.

footerContent

The content shown at the bottom of a message list item.

trailingContent

The content shown at the end of a message list item.