@@ -9,15 +9,18 @@ import { Message } from '../../types'
9
9
import useRetryTimeout from '../../hooks/useRetryTimeout'
10
10
import { useTranslation } from 'react-i18next'
11
11
import { handleCompletionStreamError } from './error'
12
- import { Box , Button } from '@mui/material'
12
+ import { Box , Button , IconButton , Modal , Typography } from '@mui/material'
13
13
import { Disclaimer } from './Disclaimer'
14
14
import { Conversation } from './Conversation'
15
15
import { ChatBox } from './ChatBox'
16
16
import { getCompletionStream } from './util'
17
17
import { SystemPrompt } from './System'
18
18
import { AppContext } from '../../util/context'
19
+ import { Close , Settings } from '@mui/icons-material'
20
+ import { SettingsModal } from './SettingsModal'
19
21
20
22
export const ChatV2 = ( ) => {
23
+ const [ settingsModalOpen , setSettingsModalOpen ] = useState ( false )
21
24
const { courseId } = useParams ( )
22
25
23
26
const { course } = useCourse ( courseId )
@@ -165,10 +168,16 @@ export const ChatV2 = () => {
165
168
flexDirection : 'column' ,
166
169
} }
167
170
>
171
+
172
+ < SettingsModal open = { settingsModalOpen } setOpen = { setSettingsModalOpen } > </ SettingsModal >
168
173
< Box sx = { { display : 'flex' , gap : '1rem' } } >
169
174
{ disclaimerInfo && < Disclaimer disclaimer = { disclaimerInfo } /> }
170
175
< SystemPrompt content = { system . content } setContent = { ( content ) => setSystem ( { content } ) } />
171
176
< Button onClick = { handleReset } > Reset</ Button >
177
+ < IconButton onClick = { ( ) => setSettingsModalOpen ( true ) } title = "Settings" >
178
+ < Settings > </ Settings >
179
+ </ IconButton >
180
+
172
181
</ Box >
173
182
< Box ref = { chatContainerRef } >
174
183
< Conversation messages = { messages } completion = { completion } />
0 commit comments