@@ -19,7 +19,7 @@ interface AIChatProps {
19
19
}
20
20
21
21
interface StoredChat {
22
- messages : ChatMessageType [ ] ;
22
+ messages : Array < ChatMessageType > ;
23
23
questionDetails : string ;
24
24
}
25
25
@@ -35,7 +35,7 @@ export const AIChat: React.FC<AIChatProps> = ({
35
35
language = 'python' ,
36
36
questionDetails = '' ,
37
37
} ) => {
38
- const [ messages , setMessages ] = useState < ChatMessageType [ ] > ( [ ] ) ;
38
+ const [ messages , setMessages ] = useState < Array < ChatMessageType > > ( [ ] ) ;
39
39
const [ isLoading , setIsLoading ] = useState < boolean > ( false ) ;
40
40
const [ error , setError ] = useState < string | null > ( null ) ;
41
41
const streamingTextRef = useRef < string > ( '' ) ;
@@ -179,7 +179,7 @@ export const AIChat: React.FC<AIChatProps> = ({
179
179
title = 'AI Assistant'
180
180
onClearHistory = { handleClearHistory }
181
181
CustomPlaceHolderElem = { ( { onSend } ) => (
182
- < div className = 'flex flex-col gap-6 text-center' >
182
+ < div className = 'flex w-full flex-col gap-6 text-center' >
183
183
< MessageSquareIcon className = 'mx-auto size-12 opacity-50' />
184
184
< p > No messages yet. Start a conversation, or use one of these prompts:</ p >
185
185
< div className = 'flex flex-wrap gap-4' >
@@ -188,7 +188,7 @@ export const AIChat: React.FC<AIChatProps> = ({
188
188
key = { index }
189
189
variant = 'outline'
190
190
size = 'sm'
191
- className = 'rounded-xl'
191
+ className = 'max-w-full whitespace-normal break-words rounded-xl '
192
192
onClick = { ( ) => onSend ( value ) }
193
193
>
194
194
< span > { value } </ span >
0 commit comments