PinnedMessageList

fun PinnedMessageList(viewModel: PinnedMessageListViewModel, modifier: Modifier = Modifier, currentUser: User? = ChatClient.instance().getCurrentUser(), onPinnedMessageClick: (Message) -> Unit = {}, itemContent: @Composable (Message) -> Unit = { DefaultPinnedMessageItem(it, currentUser, onPinnedMessageClick) }, itemDivider: @Composable (Int) -> Unit = { DefaultPinnedMessageItemDivider() }, emptyContent: @Composable () -> Unit = { DefaultPinnedMessageListEmptyContent(modifier) }, loadingContent: @Composable () -> Unit = { DefaultPinnedMessageListLoadingContent(modifier) }, loadingMoreContent: @Composable () -> Unit = { DefaultPinnedMessageListLoadingMoreContent() })

Default 'Pinned Messages List' component, which relies on PinnedMessageListViewModel to show and allow interactions with the pinned messages from a given channel.

Parameters

viewModel

The PinnedMessageListViewModel holding the data and the business logic for showing the pinned messages from a given channel.

modifier

Modifier instance for general styling.

currentUser

The currently logged User, used for formatting the message preview.

onPinnedMessageClick

Action to be invoked when the user clicks on a message from the list.

itemContent

Composable rendering each Message item in the list. Override this to provide custom component for rendering the items.

itemDivider

Composable rendering the divider between messages. Override this to provide (or remove) the default divider.

emptyContent

Composable shown when there are no pinned messages to display. Override this to provide custom component for rendering the empty state.

loadingContent

Composable shown during the initial loading of the pinned messages. Override this to provide a custom initial loading state.

loadingMoreContent

Composable shown at the bottom of the list during the loading of more pinned messages (pagination). Override this to provide a custom loading component shown during the loading of more items.