File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/client/components/ChatV2 Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import FormatQuoteIcon from '@mui/icons-material/FormatQuote'
18
18
import useLocalStorageState from '../../hooks/useLocalStorageState'
19
19
import { BlueButton } from './general/Buttons'
20
20
import type { ToolCallResultEvent , ToolCallStatusEvent } from '../../../shared/chat'
21
- import { useMemo } from 'react'
21
+ import { useId , useMemo } from 'react'
22
22
23
23
const UserMessage = ( { content, attachements } : { content : string ; attachements ?: string } ) => (
24
24
< Box
@@ -160,9 +160,12 @@ const AssistantMessage = ({
160
160
setActiveToolResult ( toolResult )
161
161
}
162
162
163
+ const msgId = useId ( )
164
+
163
165
return (
164
166
< Box
165
167
data-testid = "assistant-message"
168
+ id = { msgId }
166
169
sx = { {
167
170
position : 'relative' ,
168
171
pr : 4 ,
@@ -184,7 +187,7 @@ const AssistantMessage = ({
184
187
borderRadius : 4 ,
185
188
} }
186
189
>
187
- < CopyToClipboardButton id = { `assistant-message` } copied = { content } />
190
+ < CopyToClipboardButton id = { msgId } copied = { content } />
188
191
</ Box >
189
192
< ReactMarkdown
190
193
remarkPlugins = { [ remarkGfm , [ remarkMath , { singleDollarTextMath : false } ] ] }
You can’t perform that action at this time.
0 commit comments