add maidian

This commit is contained in:
lyf
2024-09-25 13:08:03 +08:00
parent 248d27680d
commit 77f037a3c4
4 changed files with 43 additions and 6 deletions

View File

@@ -21,7 +21,8 @@ import {
} from "./artifacts";
import { useChatStore } from "../store";
import { IconButton } from "./button";
import { SAAS_CHAT_URL } from "@/app/constant";
import { trackConversationGuideToCPaymentClick } from "../utils/auth-settings-events";
export function Mermaid(props: { code: string }) {
const ref = useRef<HTMLDivElement>(null);
const [hasError, setHasError] = useState(false);
@@ -280,7 +281,13 @@ function _MarkDownContent(props: { content: string }) {
const href = aProps.href || "";
const isInternal = /^\/#/i.test(href);
const target = isInternal ? "_self" : aProps.target ?? "_blank";
return <a {...aProps} target={target} />;
const handleClick = () => {
if (href === SAAS_CHAT_URL) {
trackConversationGuideToCPaymentClick();
}
};
return <a {...aProps} target={target} onClick={handleClick} />;
},
}}
>