ChannelItem

fun ChannelItem(channelItem: ItemState.ChannelItemState, currentUser: User?, onChannelClick: (Channel) -> Unit, onChannelLongClick: (Channel) -> Unit, modifier: Modifier = Modifier, leadingContent: @Composable RowScope.(ItemState.ChannelItemState) -> Unit = { DefaultChannelItemLeadingContent( channelItem = it, currentUser = currentUser, ) }, centerContent: @Composable RowScope.(ItemState.ChannelItemState) -> Unit = { DefaultChannelItemCenterContent( channelItemState = it, currentUser = currentUser, ) }, trailingContent: @Composable RowScope.(ItemState.ChannelItemState) -> Unit = { DefaultChannelItemTrailingContent( channel = it.channel, currentUser = currentUser, ) })

The basic channel item, that shows the channel in a list and exposes single and long click actions.

Parameters

channelItem

The channel data to show.

currentUser

The user that's currently logged in.

onChannelClick

Handler for a single tap on an item.

onChannelLongClick

Handler for a long tap on an item.

modifier

Modifier for styling.

leadingContent

Customizable composable function that represents the leading content of a channel item, usually the avatar that holds an image of the channel or its members.

centerContent

Customizable composable function that represents the center content of a channel item, usually holding information about its name and the last message.

trailingContent

Customizable composable function that represents the trailing content of the a channel item, usually information about the last message and the number of unread messages.