@Suppress("FunctionName") public fun QuotedAttachmentFactory(): AttachmentFactory = AttachmentFactory(canHandle = {if (it.isEmpty()) return@AttachmentFactory false val attachment = it.first() attachment.isFile() || attachment.isMedia() || attachment.hasLink() },content = @Composable { modifier, attachmentState ->val attachment = attachmentState.message.attachments.first() val isFile = attachment.isFile() val isImage = attachment.isMedia() val isLink = attachment.hasLink() when { isImage || isLink -> ImageAttachmentQuotedContent(modifier = modifier, attachment = attachment) isFile -> FileAttachmentQuotedContent(modifier = modifier, attachment = attachment)}})
An [AttachmentFactory] that validates attachments as files and uses [ImageAttachmentQuotedContent] in case the attachment is a media attachment or [FileAttachmentQuotedContent] in case the attachment is a file to build the UI for the quoted message.