@@ -6,7 +6,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
6
6
import { Input } from '@/components/ui/input' ;
7
7
import { ScrollArea } from '@/components/ui/scroll-area' ;
8
8
import axios from 'axios' ;
9
- import { Bot , Send , User , Loader2 , Copy , Check } from 'lucide-react' ;
9
+ import { Bot , Check , Copy , Loader2 , Send , User } from 'lucide-react' ;
10
10
import type React from 'react' ;
11
11
import { useCallback , useEffect , useRef , useState } from 'react' ;
12
12
import ReactMarkdown from 'react-markdown' ;
@@ -26,7 +26,10 @@ interface DiscussionWithAIProps {
26
26
27
27
const DiscussionWithAI : React . FC < DiscussionWithAIProps > = ( { learningid } ) => {
28
28
const [ input , setInput ] = useState < string > ( '' ) ;
29
- const [ responses , setResponses , removeResponses ] = useLocalStorage < Message [ ] > ( `chat-responses-${ learningid } ` , [ ] ) ;
29
+ const [ responses , setResponses , removeResponses ] = useLocalStorage < Message [ ] > (
30
+ `chat-responses-${ learningid } ` ,
31
+ [ ] ,
32
+ ) ;
30
33
const [ chatSession , setChatSession ] = useState < any > ( null ) ;
31
34
const [ loading , setLoading ] = useState < boolean > ( false ) ;
32
35
const [ basicQuestions , setBasicQuestions ] = useState < string [ ] > ( [ ] ) ;
@@ -156,10 +159,11 @@ const DiscussionWithAI: React.FC<DiscussionWithAIProps> = ({ learningid }) => {
156
159
className = { `flex ${ response . sender === 'user' ? 'justify-end' : 'justify-start' } ` }
157
160
>
158
161
< div
159
- className = { `p-2 rounded-lg max-w-[80%] text-sm ${ response . sender === 'user'
162
+ className = { `p-2 rounded-lg max-w-[80%] text-sm ${
163
+ response . sender === 'user'
160
164
? 'bg-primary dark:text-navy text-white'
161
165
: 'bg-secondary text-secondary-foreground'
162
- } relative group`}
166
+ } relative group`}
163
167
>
164
168
{ response . sender === 'user' ? (
165
169
< User className = "inline-block mr-2 h-4 w-4" />
@@ -210,7 +214,9 @@ const DiscussionWithAI: React.FC<DiscussionWithAIProps> = ({ learningid }) => {
210
214
</ Button >
211
215
) )
212
216
) : (
213
- < div className = "text-sm text-muted-foreground" > No suggested questions available.</ div >
217
+ < div className = "text-sm text-muted-foreground" >
218
+ No suggested questions available.
219
+ </ div >
214
220
) }
215
221
</ div >
216
222
</ ScrollArea >
@@ -244,4 +250,4 @@ const DiscussionWithAI: React.FC<DiscussionWithAIProps> = ({ learningid }) => {
244
250
) ;
245
251
} ;
246
252
247
- export default DiscussionWithAI ;
253
+ export default DiscussionWithAI ;
0 commit comments