@@ -10,6 +10,9 @@ import { useConnectStore } from "@/stores/connectStore";
1010// import SessionFile from "./SessionFile";
1111import ScrollToBottom from "@/components/Common/ScrollToBottom" ;
1212import { useChatStore } from "@/stores/chatStore" ;
13+ import { useWebConfigStore } from "@/stores/webConfigStore" ;
14+ import { useAppStore } from "@/stores/appStore" ;
15+ import { NoResults } from "../Common/UI/NoResults" ;
1316
1417interface ChatContentProps {
1518 activeChat ?: Chat ;
@@ -97,87 +100,100 @@ export const ChatContent = ({
97100 setIsAtBottom ( isAtBottom ) ;
98101 } ;
99102
103+ const { isTauri } = useAppStore ( ) ;
104+ const { disabled } = useWebConfigStore ( ) ;
105+
100106 return (
101107 < div className = "flex-1 overflow-hidden flex flex-col justify-between relative user-select-text" >
102- < div
103- ref = { scrollRef }
104- className = "flex-1 w-full overflow-x-hidden overflow-y-auto border-t border-[rgba(0,0,0,0.1)] dark:border-[rgba(255,255,255,0.15)] custom-scrollbar relative"
105- onScroll = { handleScroll }
106- >
107- { ( ! activeChat || activeChat ?. messages ?. length === 0 ) &&
108- ! visibleStartPage && < Greetings /> }
109-
110- { activeChat ?. messages ?. map ( ( message , index ) => (
111- < ChatMessage
112- key = { message . _id + index }
113- message = { message }
114- isTyping = { false }
115- onResend = { handleSendMessage }
116- />
117- ) ) }
118-
119- { ( ! curChatEnd ||
120- query_intent ||
121- tools ||
122- fetch_source ||
123- pick_source ||
124- deep_read ||
125- think ||
126- response ) &&
127- activeChat ?. _source ?. id ? (
128- < ChatMessage
129- key = { "current" }
130- message = { {
131- _id : "current" ,
132- _source : {
133- type : "assistant" ,
134- assistant_id :
135- allMessages [ allMessages . length - 1 ] ?. _source ?. assistant_id ,
136- message : "" ,
137- question : Question ,
138- } ,
139- } }
140- onResend = { handleSendMessage }
141- isTyping = { ! curChatEnd }
142- query_intent = { query_intent }
143- tools = { tools }
144- fetch_source = { fetch_source }
145- pick_source = { pick_source }
146- deep_read = { deep_read }
147- think = { think }
148- response = { response }
149- loadingStep = { loadingStep }
150- formatUrl = { formatUrl }
151- />
152- ) : null }
153-
154- { timedoutShow ? (
155- < ChatMessage
156- key = { "timedout" }
157- message = { {
158- _id : "timedout" ,
159- _source : {
160- type : "assistant" ,
161- message : t ( "assistant.chat.timedout" ) ,
162- question : Question ,
163- } ,
164- } }
165- onResend = { handleSendMessage }
166- isTyping = { false }
167- />
168- ) : null }
169- < div ref = { messagesEndRef } />
170- </ div >
171-
172- { uploadAttachments . length > 0 && (
173- < div key = { currentSessionId } className = "max-h-[120px] overflow-auto p-2" >
174- < AttachmentList />
175- </ div >
108+ { ! isTauri && disabled ? (
109+ < NoResults />
110+ ) : (
111+ < >
112+ < div
113+ ref = { scrollRef }
114+ className = "flex-1 w-full overflow-x-hidden overflow-y-auto border-t border-[rgba(0,0,0,0.1)] dark:border-[rgba(255,255,255,0.15)] custom-scrollbar relative"
115+ onScroll = { handleScroll }
116+ >
117+ { ( ! activeChat || activeChat ?. messages ?. length === 0 ) &&
118+ ! visibleStartPage && < Greetings /> }
119+
120+ { activeChat ?. messages ?. map ( ( message , index ) => (
121+ < ChatMessage
122+ key = { message . _id + index }
123+ message = { message }
124+ isTyping = { false }
125+ onResend = { handleSendMessage }
126+ />
127+ ) ) }
128+
129+ { ( ! curChatEnd ||
130+ query_intent ||
131+ tools ||
132+ fetch_source ||
133+ pick_source ||
134+ deep_read ||
135+ think ||
136+ response ) &&
137+ activeChat ?. _source ?. id ? (
138+ < ChatMessage
139+ key = { "current" }
140+ message = { {
141+ _id : "current" ,
142+ _source : {
143+ type : "assistant" ,
144+ assistant_id :
145+ allMessages [ allMessages . length - 1 ] ?. _source
146+ ?. assistant_id ,
147+ message : "" ,
148+ question : Question ,
149+ } ,
150+ } }
151+ onResend = { handleSendMessage }
152+ isTyping = { ! curChatEnd }
153+ query_intent = { query_intent }
154+ tools = { tools }
155+ fetch_source = { fetch_source }
156+ pick_source = { pick_source }
157+ deep_read = { deep_read }
158+ think = { think }
159+ response = { response }
160+ loadingStep = { loadingStep }
161+ formatUrl = { formatUrl }
162+ />
163+ ) : null }
164+
165+ { timedoutShow ? (
166+ < ChatMessage
167+ key = { "timedout" }
168+ message = { {
169+ _id : "timedout" ,
170+ _source : {
171+ type : "assistant" ,
172+ message : t ( "assistant.chat.timedout" ) ,
173+ question : Question ,
174+ } ,
175+ } }
176+ onResend = { handleSendMessage }
177+ isTyping = { false }
178+ />
179+ ) : null }
180+ < div ref = { messagesEndRef } />
181+ </ div >
182+
183+ { uploadAttachments . length > 0 && (
184+ < div
185+ key = { currentSessionId }
186+ className = "max-h-[120px] overflow-auto p-2"
187+ >
188+ < AttachmentList />
189+ </ div >
190+ ) }
191+
192+ { /* {currentSessionId && <SessionFile sessionId={currentSessionId} /> } */ }
193+
194+ < ScrollToBottom scrollRef = { scrollRef } isAtBottom = { isAtBottom } />
195+ </ >
176196 ) }
177-
178- { /* {currentSessionId && <SessionFile sessionId={currentSessionId} /> } */ }
179-
180- < ScrollToBottom scrollRef = { scrollRef } isAtBottom = { isAtBottom } />
181197 </ div >
182198 ) ;
183199} ;
0 commit comments