@@ -18,7 +18,6 @@ import { t } from 'i18next'
18
18
import FormatQuoteIcon from '@mui/icons-material/FormatQuote'
19
19
import useLocalStorageState from '../../hooks/useLocalStorageState'
20
20
import { BlueButton } from './general/Buttons'
21
- import { MutableRefObject } from 'react'
22
21
23
22
const UserMessage = ( { content, attachements } : { content : string ; attachements ?: string } ) => (
24
23
< Box
@@ -60,13 +59,13 @@ const AssistantMessage = ({
60
59
error,
61
60
fileSearchResult,
62
61
setActiveFileSearchResult,
63
- setShowAnnotations ,
62
+ setShowFileSearchResults ,
64
63
} : {
65
64
content : string
66
65
error ?: string
67
66
fileSearchResult ?: FileSearchCompletedData
68
67
setActiveFileSearchResult : ( data : FileSearchCompletedData ) => void
69
- setShowAnnotations : ( show : boolean ) => void
68
+ setShowFileSearchResults : ( show : boolean ) => void
70
69
} ) => {
71
70
const processedContent = preprocessMath ( content )
72
71
const katexOptions = {
@@ -109,9 +108,9 @@ const AssistantMessage = ({
109
108
}
110
109
let codeCount = 0
111
110
112
- const handleAnnotations = ( fileSearchResult : FileSearchCompletedData ) => {
111
+ const handleFileSearchResult = ( fileSearchResult : FileSearchCompletedData ) => {
113
112
setActiveFileSearchResult ( fileSearchResult )
114
- setShowAnnotations ( true )
113
+ setShowFileSearchResults ( true )
115
114
}
116
115
117
116
return (
@@ -232,7 +231,7 @@ const AssistantMessage = ({
232
231
borderRadius : '0.6rem' ,
233
232
} }
234
233
onClick = { ( ) => {
235
- handleAnnotations ( fileSearchResult )
234
+ handleFileSearchResult ( fileSearchResult )
236
235
} }
237
236
>
238
237
< FormatQuoteIcon sx = { { fontSize : '2rem' } } />
@@ -255,7 +254,7 @@ const AssistantMessage = ({
255
254
>
256
255
{ `${ t ( 'chat:displaySources' ) } : ` }
257
256
258
- < em > { fileSearchResult ?. searchedFiles ? .join ( '\r\n' ) } </ em >
257
+ < em > { fileSearchResult ?. searchedFileNames . join ( '\r\n' ) } </ em >
259
258
</ Typography >
260
259
</ Box >
261
260
</ Box >
@@ -271,13 +270,13 @@ const MessageItem = ({
271
270
isLastAssistantNode,
272
271
expandedNodeHeight,
273
272
setActiveFileSearchResult,
274
- setShowAnnotations ,
273
+ setShowFileSearchResults ,
275
274
} : {
276
275
message : Message
277
276
isLastAssistantNode : boolean
278
277
expandedNodeHeight : number
279
278
setActiveFileSearchResult : ( data : FileSearchCompletedData ) => void
280
- setShowAnnotations : ( show : boolean ) => void
279
+ setShowFileSearchResults : ( show : boolean ) => void
281
280
} ) => {
282
281
if ( message . role === 'assistant' ) {
283
282
return (
@@ -294,7 +293,7 @@ const MessageItem = ({
294
293
error = { message . error }
295
294
fileSearchResult = { message . fileSearchResult }
296
295
setActiveFileSearchResult = { setActiveFileSearchResult }
297
- setShowAnnotations = { setShowAnnotations }
296
+ setShowFileSearchResults = { setShowFileSearchResults }
298
297
/>
299
298
</ Box >
300
299
)
@@ -317,7 +316,7 @@ export const Conversation = ({
317
316
toolCalls,
318
317
isStreaming,
319
318
setActiveFileSearchResult,
320
- setShowAnnotations ,
319
+ setShowFileSearchResults ,
321
320
} : {
322
321
courseName ?: string
323
322
courseDate ?: ActivityPeriod
@@ -328,7 +327,7 @@ export const Conversation = ({
328
327
toolCalls : { id : string ; name ?: string } [ ]
329
328
isStreaming : boolean
330
329
setActiveFileSearchResult : ( data : FileSearchCompletedData ) => void
331
- setShowAnnotations : ( show : boolean ) => void
330
+ setShowFileSearchResults : ( show : boolean ) => void
332
331
} ) => {
333
332
const [ reminderSeen , setReminderSeen ] = useLocalStorageState < boolean > ( 'reminderSeen' , false )
334
333
@@ -356,7 +355,7 @@ export const Conversation = ({
356
355
isLastAssistantNode = { isLastAssistantNode }
357
356
expandedNodeHeight = { expandedNodeHeight }
358
357
setActiveFileSearchResult = { setActiveFileSearchResult }
359
- setShowAnnotations = { setShowAnnotations }
358
+ setShowFileSearchResults = { setShowFileSearchResults }
360
359
/>
361
360
)
362
361
} ) }
@@ -369,7 +368,7 @@ export const Conversation = ({
369
368
isLastAssistantNode = { true }
370
369
expandedNodeHeight = { expandedNodeHeight }
371
370
setActiveFileSearchResult = { setActiveFileSearchResult }
372
- setShowAnnotations = { setShowAnnotations }
371
+ setShowFileSearchResults = { setShowFileSearchResults }
373
372
/>
374
373
) : (
375
374
< LoadingMessage expandedNodeHeight = { expandedNodeHeight } isFileSearching = { toolCalls . length > 0 } />
0 commit comments