@@ -32,14 +32,12 @@ import { handleCompletionStreamError } from './error'
32
32
import ToolResult from './ToolResult'
33
33
import { OutlineButtonBlack } from './general/Buttons'
34
34
import { ChatInfo } from './general/ChatInfo'
35
- import RagSelector from './RagSelector'
35
+ import RagSelector , { RagSelectorDescription } from './RagSelector'
36
36
import { SettingsModal , useUrlPromptId } from './SettingsModal'
37
37
import { useChatStream } from './useChatStream'
38
38
import { getCompletionStreamV3 } from './util'
39
39
import PromptSelector from './PromptSelector'
40
40
import { useQuery } from '@tanstack/react-query'
41
- import { useMutation } from '@tanstack/react-query'
42
- import apiClient from '../../util/apiClient'
43
41
import ModelSelector from './ModelSelector'
44
42
45
43
function useLocalStorageStateWithURLDefault ( key : string , defaultValue : string , urlKey : string ) {
@@ -382,7 +380,6 @@ export const ChatV2 = () => {
382
380
onClose = { ( ) => {
383
381
setChatLeftSidePanelOpen ( false )
384
382
} }
385
- t = { t }
386
383
setSettingsModalOpen = { setSettingsModalOpen }
387
384
setDisclaimerStatus = { setDisclaimerStatus }
388
385
showRagSelector = { showRagSelector }
@@ -406,7 +403,6 @@ export const ChatV2 = () => {
406
403
} }
407
404
course = { course }
408
405
handleReset = { handleReset }
409
- t = { t }
410
406
setSettingsModalOpen = { setSettingsModalOpen }
411
407
setDisclaimerStatus = { setDisclaimerStatus }
412
408
showRagSelector = { showRagSelector }
@@ -599,7 +595,6 @@ const LeftMenu = ({
599
595
course,
600
596
handleReset,
601
597
onClose,
602
- t,
603
598
setSettingsModalOpen,
604
599
setDisclaimerStatus,
605
600
showRagSelector,
@@ -612,13 +607,11 @@ const LeftMenu = ({
612
607
currentModel,
613
608
setModel,
614
609
availableModels,
615
-
616
610
} : {
617
611
sx ?: object
618
612
course ?: Course
619
613
handleReset : ( ) => void
620
614
onClose ?: ( ) => void
621
- t : TFunction
622
615
setSettingsModalOpen : React . Dispatch < React . SetStateAction < boolean > >
623
616
setDisclaimerStatus : React . Dispatch < React . SetStateAction < boolean > >
624
617
showRagSelector : boolean
@@ -628,11 +621,11 @@ const LeftMenu = ({
628
621
messages : Message [ ]
629
622
activePrompt : Prompt | undefined
630
623
setActivePrompt : ( prompt : Prompt | undefined ) => void
631
-
632
624
currentModel : string
633
625
setModel : ( model : string ) => void
634
626
availableModels : string [ ]
635
627
} ) => {
628
+ const { t } = useTranslation ( )
636
629
const { courseId } = useParams ( )
637
630
const { userStatus, isLoading : statusLoading } = useUserStatus ( courseId )
638
631
const [ isTokenLimitExceeded , setIsTokenLimitExceeded ] = useState < boolean > ( false )
@@ -668,12 +661,7 @@ const LeftMenu = ({
668
661
< OutlineButtonBlack startIcon = { < RestartAltIcon /> } onClick = { handleReset } data-testid = "empty-conversation-button" >
669
662
{ t ( 'chat:emptyConversation' ) }
670
663
</ OutlineButtonBlack >
671
- < ModelSelector
672
- currentModel = { currentModel }
673
- setModel = { setModel }
674
- availableModels = { availableModels }
675
- isTokenLimitExceeded = { isTokenLimitExceeded }
676
- />
664
+ < ModelSelector currentModel = { currentModel } setModel = { setModel } availableModels = { availableModels } isTokenLimitExceeded = { isTokenLimitExceeded } />
677
665
< PromptSelector
678
666
sx = { { width : '100%' } }
679
667
coursePrompts = { course ?. prompts ?? [ ] }
@@ -692,13 +680,7 @@ const LeftMenu = ({
692
680
</ OutlineButtonBlack >
693
681
{ course && showRagSelector && (
694
682
< >
695
- < Typography variant = "h6" sx = { { mb : 1 , display : 'flex' , gap : 1 , alignItems : 'center' } } fontWeight = "bold" >
696
- < MenuBookTwoTone />
697
- { t ( 'chat:sources' ) }
698
- </ Typography >
699
- < Typography variant = "body2" sx = { { mb : 2 } } >
700
- { t ( 'settings:sourceDescription' ) }
701
- </ Typography >
683
+ < RagSelectorDescription />
702
684
< RagSelector currentRagIndex = { ragIndex } setRagIndex = { setRagIndexId } ragIndices = { ragIndices ?? [ ] } />
703
685
</ >
704
686
) }
0 commit comments