diff --git a/frontend/src/components/features/chat/chat-message.tsx b/frontend/src/components/features/chat/chat-message.tsx index 9d310f342bae..1f99a4c4506e 100644 --- a/frontend/src/components/features/chat/chat-message.tsx +++ b/frontend/src/components/features/chat/chat-message.tsx @@ -1,23 +1,21 @@ -import React from "react"; +import React, { type ComponentPropsWithoutRef } from "react"; import Markdown from "react-markdown"; import remarkGfm from "remark-gfm"; -import { code } from "../markdown/code"; import { cn } from "#/utils/utils"; -import { ul, ol } from "../markdown/list"; import { CopyToClipboardButton } from "#/components/shared/buttons/copy-to-clipboard-button"; +import { code } from "../markdown/code"; +import { ul, ol } from "../markdown/list"; -interface MarkdownLinkProps { - href?: string; - children: React.ReactNode; -} +const MarkdownLink = React.forwardRef< + HTMLAnchorElement, + ComponentPropsWithoutRef<"a"> +>(({ href, children }, ref) => ( + + {children} + +)); -function MarkdownLink({ href, children }: MarkdownLinkProps) { - return ( - - {children} - - ); -} +MarkdownLink.displayName = "MarkdownLink"; interface ChatMessageProps { type: "user" | "assistant";