@@ -6,7 +6,7 @@ import StreamChat
6
6
import SwiftUI
7
7
8
8
/// View displaying the search results in the channel list.
9
- struct SearchResultsView < Factory: ViewFactory > : View {
9
+ public struct SearchResultsView < Factory: ViewFactory > : View {
10
10
11
11
@Injected ( \. colors) private var colors
12
12
@@ -19,8 +19,30 @@ struct SearchResultsView<Factory: ViewFactory>: View {
19
19
var imageLoader : ( ChatChannel ) -> UIImage
20
20
var onSearchResultTap : ( ChannelSelectionInfo ) -> Void
21
21
var onItemAppear : ( Int ) -> Void
22
+
23
+ public init (
24
+ factory: Factory ,
25
+ selectedChannel: Binding < ChannelSelectionInfo ? > ,
26
+ searchResults: [ ChannelSelectionInfo ] ,
27
+ loadingSearchResults: Bool ,
28
+ onlineIndicatorShown: @escaping ( ChatChannel ) -> Bool ,
29
+ channelNaming: @escaping ( ChatChannel ) -> String ,
30
+ imageLoader: @escaping ( ChatChannel ) -> UIImage ,
31
+ onSearchResultTap: @escaping ( ChannelSelectionInfo ) -> Void ,
32
+ onItemAppear: @escaping ( Int ) -> Void
33
+ ) {
34
+ self . factory = factory
35
+ _selectedChannel = selectedChannel
36
+ self . searchResults = searchResults
37
+ self . loadingSearchResults = loadingSearchResults
38
+ self . onlineIndicatorShown = onlineIndicatorShown
39
+ self . channelNaming = channelNaming
40
+ self . imageLoader = imageLoader
41
+ self . onSearchResultTap = onSearchResultTap
42
+ self . onItemAppear = onItemAppear
43
+ }
22
44
23
- var body : some View {
45
+ public var body : some View {
24
46
VStack ( spacing: 0 ) {
25
47
HStack {
26
48
Text ( L10n . Message. Search. numberOfResults ( searchResults. count) )
0 commit comments