File tree Expand file tree Collapse file tree
content-gen/src/app/frontend/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { memo } from 'react' ;
1+ import { memo , useCallback } from 'react' ;
22import {
33 Text ,
44 Badge ,
@@ -26,6 +26,7 @@ export interface MessageBubbleProps {
2626export const MessageBubble = memo ( function MessageBubble ( { message } : MessageBubbleProps ) {
2727 const isUser = message . role === 'user' ;
2828 const { copied, copy } = useCopyToClipboard ( ) ;
29+ const handleCopy = useCallback ( ( ) => copy ( message . content ) , [ copy , message . content ] ) ;
2930
3031 return (
3132 < div
@@ -101,7 +102,7 @@ export const MessageBubble = memo(function MessageBubble({ message }: MessageBub
101102 appearance = "subtle"
102103 icon = { < Copy20Regular /> }
103104 size = "small"
104- onClick = { ( ) => copy ( message . content ) }
105+ onClick = { handleCopy }
105106 style = { {
106107 minWidth : '28px' ,
107108 height : '28px' ,
You can’t perform that action at this time.
0 commit comments