diff --git a/src/frontend/src/modals/formModal/chatMessage/index.tsx b/src/frontend/src/modals/formModal/chatMessage/index.tsx index 44e57accb..08cc2d22b 100644 --- a/src/frontend/src/modals/formModal/chatMessage/index.tsx +++ b/src/frontend/src/modals/formModal/chatMessage/index.tsx @@ -78,69 +78,75 @@ export default function ChatMessage({
{useMemo( - () => ( - + ) : ( + {props.children}; - }, - code: ({ - node, - inline, - className, - children, - ...props - }) => { - if (children.length) { - if (children[0] === "▍") { - return ( - - ▍ - + components={{ + pre({ node, ...props }) { + return <>{props.children}; + }, + code: ({ + node, + inline, + className, + children, + ...props + }) => { + if (children.length) { + if (children[0] === "▍") { + return ( + + ▍ + + ); + } + + children[0] = (children[0] as string).replace( + "`▍`", + "▍" ); } - children[0] = (children[0] as string).replace( - "`▍`", - "▍" + const match = /language-(\w+)/.exec( + className || "" ); - } - const match = /language-(\w+)/.exec( - className || "" - ); - - return !inline ? ( - {}} - /> - ) : ( - - {children} - - ); - }, - }} - > - {chat.message.toString()} - - ), + return !inline ? ( + {}} + /> + ) : ( + + {children} + + ); + }, + }} + > + {chat.message.toString()} + + ), [chat.message, chat.message.toString()] )}
diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts index ad0b1c147..112ea6368 100644 --- a/src/frontend/src/utils/styleUtils.ts +++ b/src/frontend/src/utils/styleUtils.ts @@ -41,6 +41,7 @@ import { MessageSquare, MessagesSquare, MoonIcon, + MoreHorizontal, Paperclip, Plus, Redo, @@ -268,6 +269,7 @@ export const nodeIconsLucide = { Copy, Upload, MessageSquare, + MoreHorizontal, }; export function getConnectedNodes(edge: Edge, nodes: Array): Array { const sourceId = edge.source;