import { Button, Anchor } from "@mantine/core"; import React from "react"; import ReactMarkdown from "react-markdown"; import rehypeRaw from "rehype-raw"; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { okaidia } from "react-syntax-highlighter/dist/esm/styles/prism"; import CodeButtons from "./CodeButtons"; interface IProps { messageText: string } const MessageMarkdown = (props: IProps) => { const { messageText } = props; const LanguageCorner = (props: any) => { const { language } = props; return (
{children}
);
},
button({ node, className, children, value, ...props }) {
return (
);
},
a({ node, className, children, href, ...props }) {
const customAnchors = ["#code",
"#commit_message",
"#release_note",
"#ask_code",
"#extension"].filter((item) => item === href);
return customAnchors.length > 0
?