mirror of https://github.com/MaxLeiter/Drift
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			16 lines
		
	
	
		
			693 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			16 lines
		
	
	
		
			693 B
		
	
	
	
		
			TypeScript
		
	
import { memo } from "react"
 | 
						|
import ReactMarkdown from "react-markdown"
 | 
						|
import remarkGfm from "remark-gfm"
 | 
						|
// @ts-ignore because of no types in remark-a11y-emoji
 | 
						|
import a11yEmoji from '@fec/remark-a11y-emoji';
 | 
						|
import styles from './preview.module.css'
 | 
						|
 | 
						|
const MarkdownPreview = ({ content, height }: { content?: string, height?: number | string }) => {
 | 
						|
    {/* remarkGfm is github flavored markdown support, a11yEmoji wraps emojis in accessible spans for screen readers */ }
 | 
						|
    return (<div style={{ height }}><ReactMarkdown className={styles.markdownPreview} remarkPlugins={[remarkGfm, a11yEmoji]} >
 | 
						|
        {content || ""}
 | 
						|
    </ReactMarkdown></div>)
 | 
						|
}
 | 
						|
 | 
						|
export default memo(MarkdownPreview)
 |