MyCrypto/common/components/Translate.tsx

25 lines
524 B
TypeScript

import React from 'react';
import Markdown from 'react-markdown';
import NewTabLink from 'components/ui/NewTabLink';
interface Props {
source: string;
}
const TranslateMarkdown = ({ source }: Props) => {
return (
<Markdown
escapeHtml={true}
unwrapDisallowed={true}
allowedTypes={['link', 'emphasis', 'strong', 'code', 'root', 'inlineCode']}
renderers={{
root: React.Fragment,
link: NewTabLink
}}
source={source}
/>
);
};
export default TranslateMarkdown;