diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRowTimestampPreview.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRowTimestampPreview.kt index 12a6125404..8933538b8a 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRowTimestampPreview.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemEventRowTimestampPreview.kt @@ -22,18 +22,25 @@ internal fun TimelineItemEventRowTimestampPreview( @PreviewParameter(TimelineItemEventForTimestampViewProvider::class) event: TimelineItem.Event ) = ElementPreview { Column { - val oldContent = event.content as TimelineItemTextContent - listOf( - "Text", - "Text longer, displayed on 1 line", - "Text which should be rendered on several lines", - ).forEach { str -> - ATimelineItemEventRow( - event = event.copy( - content = oldContent.copy( - body = str, - pillifiedBody = str, + when (event.content) { + is TimelineItemTextContent -> listOf( + "Text", + "Text longer, displayed on 1 line", + "Text which should be rendered on several lines", + ).forEach { str -> + ATimelineItemEventRow( + event = event.copy( + content = event.content.copy( + body = str, + pillifiedBody = str, + ), + reactionsState = aTimelineItemReactions(count = 0), ), + ) + } + else -> ATimelineItemEventRow( + event = event.copy( + content = event.content, reactionsState = aTimelineItemReactions(count = 0), ), )