@Composable internal fun DefaultFilesPickerItem( fileItem: AttachmentPickerItemState, onItemSelected: (AttachmentPickerItemState) -> Unit, ) { Row( Modifier.fillMaxWidth().clickable(interactionSource = remember { MutableInteractionSource() },indication = rememberRipple(),onClick = { onItemSelected(fileItem) }).padding(vertical = 8.dp, horizontal = 16.dp),verticalAlignment = Alignment.CenterVertically) { Box(contentAlignment = Alignment.Center) { Checkbox(checked = fileItem.isSelected,onCheckedChange = null,colors = CheckboxDefaults.colors(checkedColor = ChatTheme.colors.primaryAccent,uncheckedColor = ChatTheme.colors.disabled,checkmarkColor = Color.White,disabledColor = ChatTheme.colors.disabled,disabledIndeterminateColor = ChatTheme.colors.disabled),)} FilesPickerItemImage( fileItem = fileItem, modifier = Modifier .padding(start = 16.dp) .size(size = 40.dp) ) Column( modifier = Modifier.padding(start = 16.dp), horizontalAlignment = Alignment.Start, verticalArrangement = Arrangement.Center ) { Text( text = fileItem.attachmentMetaData.title ?: "", style = ChatTheme.typography.bodyBold, color = ChatTheme.colors.textHighEmphasis, ) Text( text = MediaStringUtil.convertFileSizeByteCount(fileItem.attachmentMetaData.size), style = ChatTheme.typography.footnote, color = ChatTheme.colors.textLowEmphasis, ) } } }
Represents a single item in the file picker list.@param fileItem File to render.@param onItemSelected Handler when the item is selected.