Create an Interface Object

Create an object that inherits from the ViewComponent interface. Pass this to the UI client to define how to treat each ChatFeedEntry type using the EntryRenderMode.

val entryRenderMode: ((entry: ChatFeedEntry) -> EntryRenderMode) = { entry ->
   when (entry.contentType) {
// Display participant changed events using the existing UI
       ConversationEntryType.ParticipantChanged.name -> EntryRenderMode.Existing
	// Replace the UI for any Message type entry with the UI you provide
       ConversationEntryType.Message.name -> EntryRenderMode.None
	// Ignore RoutingWorkResult type entries
       ConversationEntryType.RoutingWorkResult.name -> EntryRenderMode.Ignore
       else -> EntryRenderMode.Existing
   }
}
uiClient.viewComponents = object : ViewComponents {
   @Composable
   override fun ChatFeedEntry(entry: ChatFeedEntry, content: @Composable () -> Unit) {
       when (entryRenderMode(entry)) {
           EntryRenderMode.None -> Unit
// Display default content
           EntryRenderMode.Existing -> content()
           EntryRenderMode.Replace -> ReplacementEntry(entry, uiClient.conversationClient(appContext))
       }
   }
}

note: All entries of a type are affected by the EntryRenderMode you set for that type. Use this feature with caution! For example, if you choose to hide RoutingWorkResult entries, it affects transfer events and estimated wait time.