import { Box, Typography } from "@mui/material"; import Markdown from "react-markdown"; import remarkMath from "remark-math"; import rehypeKatex from "rehype-katex"; import remarkGfm from "remark-gfm"; import remarkBreaks from "remark-breaks"; type ReasoningElementProps = { label: string; text: string; dataTestId?: string; }; function ReasoningElement({ label, text, dataTestId }: ReasoningElementProps) { return ( {label} {children} ); }, img(props) { const { ref, ...imgProps } = props; return ( ); }, table(props) { const { children } = props; return (
{children}
); }, ul(props) { return ( {props.children} ); }, ol(props) { return ( {props.children} ); }, li(props) { return ( {props.children} ); }, strong(props) { return ( {props.children} ); }, em(props) { return ( {props.children} ); }, }} remarkPlugins={[remarkMath, remarkBreaks, remarkGfm]} rehypePlugins={[rehypeKatex]} > {text?.toString()}
); } export default ReasoningElement;