Files
simplex-chat/apps/ios/Shared/Views/Chat/ComposeMessage/ComposeChatLinkView.swift
T
EvgenyandEvgeny @ SimpleX Chat 77f9f4a464 core: add peer type "agent" (#7738)
* 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>
2026-10-17 19:23:53 +01:00

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)
}
}