import React from 'react';
import ReactMarkdown from 'react-markdown';

type MarkdownRendererProps = {
  markdown: string;
};

const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({ markdown }) => (
  <ReactMarkdown
    components={{
      p: ({ ...props }) => <p style={{ margin: 0 }} {...props} />,
    }}
  >
    {markdown}
  </ReactMarkdown>
);

export default MarkdownRenderer;
