mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-04 08:37:30 +00:00
* add agent peer type * bot types * agent app icons * refactor * smaller image --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
43 lines
1.3 KiB
Swift
43 lines
1.3 KiB
Swift
import SwiftUI
|
|
import SimpleXChat
|
|
|
|
struct ComposeChatLinkView: View {
|
|
@EnvironmentObject var theme: AppTheme
|
|
var chatLink: MsgChatLink
|
|
var cancelPreview: () -> Void
|
|
let cancelEnabled: Bool
|
|
|
|
var body: some View {
|
|
HStack(alignment: .center, spacing: 8) {
|
|
ProfileImage(
|
|
imageStr: chatLink.image,
|
|
icon: Image(systemName: chatLink.iconName),
|
|
size: 44
|
|
)
|
|
.padding(.leading, 12)
|
|
VStack(alignment: .leading, spacing: 2) {
|
|
Text(chatLink.displayName)
|
|
.font(.headline)
|
|
.lineLimit(1)
|
|
if let descr = chatLink.shortDescription {
|
|
Text(descr)
|
|
.font(.caption)
|
|
.foregroundColor(theme.colors.secondary)
|
|
.lineLimit(1)
|
|
}
|
|
}
|
|
.padding(.vertical, 5)
|
|
Spacer()
|
|
if cancelEnabled {
|
|
Button { cancelPreview() } label: {
|
|
Image(systemName: "multiply")
|
|
}
|
|
}
|
|
}
|
|
.padding(.vertical, 8)
|
|
.padding(.trailing, 12)
|
|
.background(theme.appColors.sentMessage)
|
|
.frame(maxWidth: .infinity)
|
|
}
|
|
}
|