@OptIn(ExperimentalFoundationApi::class)@Composablepublic fun ChannelItem(channelItem: ChannelItemState,currentUser: User?,onChannelClick: (Channel) -> Unit,onChannelLongClick: (Channel) -> Unit,modifier: Modifier = Modifier,leadingContent: @Composable RowScope.(ChannelItemState) -> Unit = {DefaultChannelItemLeadingContent(channelItem = it,currentUser = currentUser)},centerContent: @Composable RowScope.(ChannelItemState) -> Unit = { DefaultChannelItemCenterContent(channel = it.channel,isMuted = it.isMuted,currentUser = currentUser)},trailingContent: @Composable RowScope.(ChannelItemState) -> Unit = {DefaultChannelItemTrailingContent(channel = it.channel,currentUser = currentUser,)},) {val channel = channelItem.channelval description = stringResource(id = R.string.stream_compose_cd_channel_item)Column(modifier = modifier.fillMaxWidth().wrapContentHeight().semantics { contentDescription = description}.combinedClickable(onClick = { onChannelClick(channel) },onLongClick = { onChannelLongClick(channel) },indication = rememberRipple(),interactionSource = remember { MutableInteractionSource() }),) {Row(modifier = Modifier.fillMaxWidth(),verticalAlignment = Alignment.CenterVertically,) {leadingContent(channelItem)centerContent(channelItem)trailingContent(channelItem)}}}
The basic channel item, that shows the channel in a list and exposes single and long click actions.