File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
src/components/KymaCompanion/components/Chat Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export default function Chat() {
4646 const sessionID = useRecoilValue < string > ( sessionIDState ) ;
4747 const cluster = useRecoilValue < any > ( clusterState ) ;
4848 const authData = useRecoilValue < any > ( authDataState ) ;
49+ const [ loading , setLoading ] = useState < boolean > ( false ) ;
4950
5051 const {
5152 initialSuggestions,
@@ -83,6 +84,7 @@ export default function Chat() {
8384 certificateAuthorityData :
8485 cluster . currentContext . cluster . cluster [ 'certificate-authority-data' ] ,
8586 } ) ;
87+ setLoading ( false ) ;
8688 }
8789 setChatHistory ( prevMessages => {
8890 const [ latestMessage ] = prevMessages . slice ( - 1 ) ;
@@ -110,6 +112,7 @@ export default function Chat() {
110112
111113 const sendPrompt = ( query : string ) => {
112114 setError ( null ) ;
115+ setLoading ( true ) ;
113116 addMessage ( {
114117 author : 'user' ,
115118 messageChunks : [
@@ -250,6 +253,7 @@ export default function Chat() {
250253 < div className = "outer-input-container sap-margin-x-small sap-margin-bottom-small sap-margin-top-tiny" >
251254 < div className = "input-container" >
252255 < TextArea
256+ disabled = { loading }
253257 className = "full-width"
254258 growing
255259 growingMaxRows = { 10 }
@@ -270,7 +274,8 @@ export default function Chat() {
270274 < Icon
271275 id = "text-area-icon"
272276 name = "paper-plane"
273- mode = "Interactive"
277+ mode = { loading ? 'Image' : 'Interactive' }
278+ design = { loading ? 'NonInteractive' : 'Default' }
274279 onClick = { onSubmitInput }
275280 />
276281 </ div >
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ export default function Message({
7373 const segmentedText = segmentMarkdownText (
7474 messageChunks . slice ( - 1 ) [ 0 ] ?. data ?. answer ?. content ,
7575 ) ;
76+
7677 return (
7778 < div className = { 'message ' + className } >
7879 { segmentedText && (
You can’t perform that action at this time.
0 commit comments