import katex from 'katex';

export default function Katex({ math, block = false }) {
  const html = katex.renderToString(math, {
    throwOnError: false,
    displayMode: block,
  });
  
  return <span dangerouslySetInnerHTML={{ __html: html }} />;
}
