ThreadItem

fun ThreadItem(thread: Thread, currentUser: User?, onThreadClick: (Thread) -> Unit, modifier: Modifier = Modifier, titleContent: @Composable (Channel) -> Unit = { channel -> DefaultThreadTitle(channel, currentUser) }, replyToContent: @Composable RowScope.(parentMessage: Message) -> Unit = { parentMessage -> DefaultReplyToContent(parentMessage) }, unreadCountContent: @Composable RowScope.(unreadCount: Int) -> Unit = { unreadCount -> DefaultUnreadCountContent(unreadCount) }, latestReplyContent: @Composable (reply: Message) -> Unit = { reply -> DefaultLatestReplyContent(reply) })

The basic Thread item, showing information about the Thread title, parent message, last reply and number of unread replies.

Parameters

thread

The Thread object holding the data to be rendered.

currentUser

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

onThreadClick

Action invoked when the user clicks on the item.

modifier

Modifier instance for general styling.

titleContent

Composable rendering the title of the thread item. Defaults to a 'thread' icon and the name of the channel in which the thread resides.

replyToContent

Composable rendering the preview of the thread parent message. Defaults to a preview of the parent message with a 'replied to:' prefix.

unreadCountContent

Composable rendering the badge indicator of unread replies in a thread. Defaults to a red circular badge with the unread count inside.

latestReplyContent

Composable rendering the preview of the latest reply in the thread. Defaults to a content composed of the reply author image, reply author name, preview of the reply text and a timestamp.