@@ -24,12 +24,11 @@ const PlanChat: React.FC<PlanChatProps> = ({
2424 planData,
2525 input,
2626 loading,
27+ setInput,
2728 submittingChatDisableInput,
2829 OnChatSubmit,
2930} ) => {
3031 const messages = planData ?. messages || [ ] ;
31- const [ inputValue , setInput ] = useState ( input ) ;
32- const [ isTyping , setIsTyping ] = useState ( false ) ;
3332 const [ showScrollButton , setShowScrollButton ] = useState ( false ) ;
3433 const [ inputHeight , setInputHeight ] = useState ( 0 ) ;
3534
@@ -61,7 +60,7 @@ const PlanChat: React.FC<PlanChatProps> = ({
6160 if ( inputContainerRef . current ) {
6261 setInputHeight ( inputContainerRef . current . offsetHeight ) ;
6362 }
64- } , [ inputValue ] ) ; // or [inputValue, submittingChatDisableInput]
63+ } , [ input ] ) ; // or [inputValue, submittingChatDisableInput]
6564
6665
6766
@@ -164,17 +163,17 @@ const PlanChat: React.FC<PlanChatProps> = ({
164163 < div ref = { inputContainerRef } className = "plan-chat-input-container" >
165164 < div className = "plan-chat-input-wrapper" >
166165 < ChatInput
167- value = { inputValue }
166+ value = { input }
168167 onChange = { setInput }
169- onEnter = { ( ) => OnChatSubmit ( inputValue ) }
168+ onEnter = { ( ) => OnChatSubmit ( input ) }
170169 disabledChat = {
171170 planData . enableChat ? submittingChatDisableInput : true
172171 }
173172 placeholder = "Add more info to this task..."
174173 >
175174 < Button
176175 appearance = "transparent"
177- onClick = { ( ) => OnChatSubmit ( inputValue ) }
176+ onClick = { ( ) => OnChatSubmit ( input ) }
178177 icon = { < Send /> }
179178 disabled = { planData . enableChat ? submittingChatDisableInput : true }
180179 />
0 commit comments