another.im-ios/ConversationsClassic/View/Screens/Conversation/ConversationMessageContainer.swift

37 lines
1,009 B
Swift
Raw Normal View History

2024-06-27 11:39:41 +00:00
import SwiftUI
struct ConversationMessageContainer: View {
let message: Message
let isOutgoing: Bool
var body: some View {
Text(message.body ?? "...")
.font(.body2)
2024-07-04 08:21:12 +00:00
.foregroundColor(.Material.Text.main)
2024-06-27 11:39:41 +00:00
.multilineTextAlignment(.leading)
.padding(10)
}
}
struct MessageAttr: View {
let message: Message
var body: some View {
VStack(alignment: .leading, spacing: 0) {
Text(message.date, style: .time)
.font(.sub2)
2024-07-04 08:21:12 +00:00
.foregroundColor(.Material.Shape.separator)
2024-06-27 11:39:41 +00:00
Spacer()
if message.sentError {
Image(systemName: "exclamationmark.circle")
.font(.body3)
2024-07-04 08:21:12 +00:00
.foregroundColor(.Rainbow.red500)
2024-06-27 11:39:41 +00:00
} else if message.pending {
Image(systemName: "clock")
.font(.body3)
2024-07-04 08:21:12 +00:00
.foregroundColor(.Material.Shape.separator)
2024-06-27 11:39:41 +00:00
}
}
}
}