@@ -14,7 +14,7 @@ import { ChatDismiss20Regular, HeartRegular } from "@fluentui/react-icons";
1414import ChatInput from "./ChatInput" ;
1515import "./Chat.css" ;
1616import "./prism-material-oceanic.css" ;
17- import { chatService } from "../services/chatService" ;
17+ // import { chatService } from "../services/chatService";
1818import HeaderTools from "../components/Header/HeaderTools" ;
1919
2020interface ChatProps {
@@ -62,8 +62,8 @@ const Chat: React.FC<ChatProps> = ({
6262 return ;
6363 }
6464 }
65- const chatMessages = await chatService . getUserHistory ( userId ) ;
66- setMessages ( chatMessages ) ;
65+ // const chatMessages = await chatService.getUserHistory(userId);
66+ // setMessages(chatMessages);
6767 } catch ( err ) {
6868 console . error ( "Failed to load chat history." , err ) ;
6969 }
@@ -147,10 +147,10 @@ const Chat: React.FC<ChatProps> = ({
147147 onSaveMessage ?.( userId , newHistory ) ;
148148 }
149149 } else {
150- const response = await chatService . sendMessage ( userId , input , currentConversationId ) ;
151- setCurrentConversationId ( response . conversation_id ) ;
152- const assistantMessage = { role : "assistant" , content : response . assistant_response } ;
153- setMessages ( [ ...updatedMessages , assistantMessage ] ) ;
150+ // const response = await chatService.sendMessage(userId, input, currentConversationId);
151+ // setCurrentConversationId(response.conversation_id);
152+ // const assistantMessage = { role: "assistant", content: response.assistant_response };
153+ // setMessages([...updatedMessages, assistantMessage]);
154154 }
155155 } catch ( err ) {
156156 console . error ( "Send Message Error:" , err ) ;
@@ -168,7 +168,7 @@ const Chat: React.FC<ChatProps> = ({
168168 if ( onClearHistory ) {
169169 onClearHistory ( userId ) ;
170170 } else {
171- await chatService . clearChatHistory ( userId ) ;
171+ // await chatService.clearChatHistory(userId);
172172 }
173173 setMessages ( [ ] ) ;
174174 setCurrentConversationId ( undefined ) ;
@@ -228,44 +228,44 @@ const Chat: React.FC<ChatProps> = ({
228228 style = { {
229229 bottom : inputHeight ,
230230 backgroundColor : "transparent" ,
231- border :'1px solid var(--colorNeutralStroke3)' ,
231+ border : '1px solid var(--colorNeutralStroke3)' ,
232232 backdropFilter : "saturate(180%) blur(16px)" ,
233233 } }
234234 >
235235 Back to bottom
236236 </ Tag >
237237 ) }
238238
239- < div ref = { inputContainerRef } style = { { display :'flex' , width :'100%' , alignItems :'center' , justifyContent :'center' } } >
240- < div style = { { display :'flex' , width :'100%' , maxWidth :'768px' , margin :'0px 16px' } } >
241- < ChatInput
242- value = { input }
243- onChange = { setInput }
244- onEnter = { sendMessage }
239+ < div ref = { inputContainerRef } style = { { display : 'flex' , width : '100%' , alignItems : 'center' , justifyContent : 'center' } } >
240+ < div style = { { display : 'flex' , width : '100%' , maxWidth : '768px' , margin : '0px 16px' } } >
241+ < ChatInput
242+ value = { input }
243+ onChange = { setInput }
244+ onEnter = { sendMessage }
245245
246- >
247- < Button
248- appearance = "transparent"
249- onClick = { sendMessage }
250- icon = { < Send /> }
251- disabled = { isTyping || ! input . trim ( ) }
252- />
246+ >
247+ < Button
248+ appearance = "transparent"
249+ onClick = { sendMessage }
250+ icon = { < Send /> }
251+ disabled = { isTyping || ! input . trim ( ) }
252+ />
253253
254- { messages . length > 0 && (
255- < HeaderTools >
256- < ToolbarDivider />
257- < Button
254+ { messages . length > 0 && (
255+ < HeaderTools >
256+ < ToolbarDivider />
257+ < Button
258258
259- onClick = { clearChat }
260- appearance = "transparent"
261- icon = { < ChatDismiss20Regular /> }
262- disabled = { isTyping || messages . length === 0 } />
259+ onClick = { clearChat }
260+ appearance = "transparent"
261+ icon = { < ChatDismiss20Regular /> }
262+ disabled = { isTyping || messages . length === 0 } />
263263
264- </ HeaderTools >
264+ </ HeaderTools >
265265
266- ) }
266+ ) }
267267
268- </ ChatInput >
268+ </ ChatInput >
269269 </ div >
270270
271271 </ div >
0 commit comments