@@ -15,6 +15,20 @@ public struct FileAttachmentsContainer<Factory: ViewFactory>: View {
15
15
var isFirst : Bool
16
16
@Binding var scrolledId : String ?
17
17
18
+ public init (
19
+ factory: Factory ,
20
+ message: ChatMessage ,
21
+ width: CGFloat ,
22
+ isFirst: Bool ,
23
+ scrolledId: Binding < String ? >
24
+ ) {
25
+ self . factory = factory
26
+ self . message = message
27
+ self . width = width
28
+ self . isFirst = isFirst
29
+ _scrolledId = scrolledId
30
+ }
31
+
18
32
public var body : some View {
19
33
VStack ( alignment: message. alignmentInBubble) {
20
34
if let quotedMessage = utils. messageCachingUtils. quotedMessage ( for: message) {
@@ -77,6 +91,12 @@ public struct FileAttachmentView: View {
77
91
var width : CGFloat
78
92
var isFirst : Bool
79
93
94
+ public init ( attachment: ChatMessageFileAttachment , width: CGFloat , isFirst: Bool ) {
95
+ self . attachment = attachment
96
+ self . width = width
97
+ self . isFirst = isFirst
98
+ }
99
+
80
100
public var body : some View {
81
101
HStack {
82
102
FileAttachmentDisplayView (
@@ -102,7 +122,8 @@ public struct FileAttachmentView: View {
102
122
}
103
123
}
104
124
105
- struct FileAttachmentDisplayView : View {
125
+ public struct FileAttachmentDisplayView : View {
126
+
106
127
@Injected ( \. images) private var images
107
128
@Injected ( \. fonts) private var fonts
108
129
@Injected ( \. colors) private var colors
@@ -111,7 +132,13 @@ struct FileAttachmentDisplayView: View {
111
132
var title : String
112
133
var sizeString : String
113
134
114
- var body : some View {
135
+ public init ( url: URL , title: String , sizeString: String ) {
136
+ self . url = url
137
+ self . title = title
138
+ self . sizeString = sizeString
139
+ }
140
+
141
+ public var body : some View {
115
142
HStack {
116
143
Image ( uiImage: previewImage)
117
144
. resizable ( )
0 commit comments