import SwiftUI import KordophoneKit struct ConversationRow : View { var conversation: Conversation var body: some View { HStack { Circle() .frame(width: 10, height: 10) .padding(4) .opacity(conversation.unreadCount > 0 ? 1.0 : 0.0) .foregroundColor(.accentColor) VStack { HStack { Text(conversation.effectiveDisplayName) Spacer() Text(conversation.date, style: .time) } HStack { Text(conversation.lastMessagePreview) .multilineTextAlignment(.leading) Spacer() } } } } } struct ConversationRow_Previews : PreviewProvider { static var previews: some View { Group { ForEach(Conversation.samples) { convo in ConversationRow(conversation: convo) } } } }