@Composable public fun ChannelListHeader(modifier: Modifier = Modifier,title: String = "",currentUser: User? = null,connectionState: ConnectionState ConnectionState.CONNECTED,color: Color = ChatTheme.colors.barsBackground,shape: Shape = ChatTheme.shapes.header,elevation: Dp ChatTheme.dimens.headerElevation,onAvatarClick: (User?) -> Unit = {},onHeaderActionClick: () -> Unit = {},leadingContent: @Composable RowScope.() -> Unit = { DefaultChannelHeaderLeadingContent(currentUser = currentUser,onAvatarClick = onAvatarClick)},centerContent: @Composable RowScope.() -> Unit = { DefaultChannelListHeaderCenterContent( connectionState = connectionState,title = title)},trailingContent: @Composable RowScope.() -> Unit = {DefaultChannelListHeaderTrailingContent(onHeaderActionClick = onHeaderActionClick)},) {Surface(modifier = modifier.fillMaxWidth(),elevation = elevation,color = color,shape = shape) {Row(Modifier.fillMaxWidth().padding(8.dp),verticalAlignment = Alignment.CenterVertically,) {leadingContent()centerContent()trailingContent()}}}
A clean, decoupled UI element that doesn't rely on ViewModels or our custom architecture setup. This allows the user to fully govern how the [ChannelListHeader] behaves, by passing in all the data that's required to display it and drive its actions.