2022-11-21 08:31:32 +00:00
|
|
|
import SwiftUI
|
|
|
|
import Network
|
|
|
|
|
|
|
|
struct StatusRowView: View {
|
|
|
|
let status: Status
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
VStack(alignment: .leading) {
|
2022-11-25 11:00:01 +00:00
|
|
|
HStack(alignment: .top) {
|
2022-11-21 08:31:32 +00:00
|
|
|
AsyncImage(
|
|
|
|
url: status.account.avatar,
|
|
|
|
content: { image in
|
|
|
|
image.resizable()
|
|
|
|
.aspectRatio(contentMode: .fit)
|
2022-11-21 13:42:59 +00:00
|
|
|
.cornerRadius(4)
|
|
|
|
.frame(maxWidth: 40, maxHeight: 40)
|
2022-11-21 08:31:32 +00:00
|
|
|
},
|
|
|
|
placeholder: {
|
|
|
|
ProgressView()
|
2022-11-21 13:42:59 +00:00
|
|
|
.frame(maxWidth: 40, maxHeight: 40)
|
2022-11-21 08:31:32 +00:00
|
|
|
}
|
|
|
|
)
|
2022-11-21 13:42:59 +00:00
|
|
|
VStack(alignment: .leading) {
|
|
|
|
Text(status.account.displayName)
|
|
|
|
.font(.headline)
|
|
|
|
Text("@\(status.account.acct)")
|
|
|
|
.font(.footnote)
|
|
|
|
.foregroundColor(.gray)
|
|
|
|
}
|
2022-11-25 11:00:01 +00:00
|
|
|
Spacer()
|
|
|
|
Text(status.createdAtFormatted)
|
|
|
|
.font(.footnote)
|
|
|
|
.foregroundColor(.gray)
|
2022-11-21 08:31:32 +00:00
|
|
|
}
|
2022-11-25 09:03:42 +00:00
|
|
|
Text(try! AttributedString(markdown: status.contentAsMarkdown))
|
2022-11-21 08:31:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|