import ReactMarkdown, { Options } from 'react-markdown';

import rehypeRaw from 'rehype-raw';

interface RenderMarkdownProps extends React.HTMLAttributes<HTMLDivElement> {
  children: string;
}

/** component that render markdown & plain html */
const RenderMarkdown: React.FC<RenderMarkdownProps & Options> = (props) => {
  return <ReactMarkdown {...props} rehypePlugins={[rehypeRaw]} />;
};

export default RenderMarkdown;
