@@ -25,14 +25,12 @@ struct ChatPanel: View {
2525
2626 // close button
2727 Button ( action: {
28- viewModel. isPanelDisplayed = false
29- viewModel. content = . empty
30- chat. stop ( )
28+ chat. close ( )
3129 } ) {
3230 Image ( systemName: " xmark " )
3331 . padding ( 8 )
3432 . background ( . regularMaterial, in: Circle ( ) )
35- . padding ( [ . leading , . bottom ] , 8 )
33+ . padding ( 4 )
3634 . foregroundStyle ( . secondary)
3735 }
3836 . buttonStyle ( . plain)
@@ -196,7 +194,6 @@ struct ChatPanel_Preview: PreviewProvider {
196194
197195 static var previews : some View {
198196 ChatPanel ( viewModel: . init(
199- content: . empty,
200197 isPanelDisplayed: true
201198 ) , chat: . init(
202199 history: ChatPanel_Preview . history,
@@ -212,7 +209,6 @@ struct ChatPanel_Preview: PreviewProvider {
212209struct ChatPanel_InputText_Preview : PreviewProvider {
213210 static var previews : some View {
214211 ChatPanel ( viewModel: . init(
215- content: . empty,
216212 isPanelDisplayed: true
217213 ) , chat: . init(
218214 history: ChatPanel_Preview . history,
@@ -229,7 +225,6 @@ struct ChatPanel_InputMultilineText_Preview: PreviewProvider {
229225 static var previews : some View {
230226 ChatPanel (
231227 viewModel: . init(
232- content: . empty,
233228 isPanelDisplayed: true
234229 ) ,
235230 chat: . init(
@@ -248,7 +243,6 @@ struct ChatPanel_InputMultilineText_Preview: PreviewProvider {
248243struct ChatPanel_Light_Preview : PreviewProvider {
249244 static var previews : some View {
250245 ChatPanel ( viewModel: . init(
251- content: . empty,
252246 isPanelDisplayed: true
253247 ) , chat: . init(
254248 history: ChatPanel_Preview . history,
0 commit comments