import { useMemo } from 'react' import ReactMarkdown from 'react-markdown' import gfm from 'remark-gfm' import Tex from '@matejmazur/react-katex' import math from 'remark-math' import 'katex/dist/katex.min.css' import { Emoji, emojiPlugin, isStringWithOnlyOneEmoji } from 'components/Emoji' export interface MessageTextProps { value: string } export const MessageText: React.FC = (props) => { const isMessageWithOnlyOneEmoji = useMemo(() => { return isStringWithOnlyOneEmoji(props.value) }, [props.value]) if (isMessageWithOnlyOneEmoji) { return (

) } return ( <> , math: ({ value }) => , emoji: ({ value }) => { return } }} > {props.value} ) }