23 lines
586 B
Swift
23 lines
586 B
Swift
import Foundation
|
|
import SwiftUI
|
|
|
|
struct MessageContainer: View {
|
|
let message: Message
|
|
let isOutgoing: Bool
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
// bg
|
|
Color.Main.backgroundDark
|
|
.ignoresSafeArea()
|
|
|
|
// TODO: make custom body for different message types
|
|
// body
|
|
Text(message.body ?? "...")
|
|
.multilineTextAlignment(.leading)
|
|
.foregroundColor(Color.Main.black)
|
|
.background(isOutgoing ? Color.Material.greenDark200 : Color.Main.white)
|
|
}
|
|
}
|
|
}
|