openreplay/frontend/app/components/ui/HighlightCode/HighlightCode.js
2021-05-04 20:05:28 +05:30

18 lines
473 B
JavaScript

import React from 'react'
import Highlight from 'react-highlight'
import stl from './highlightCode.css'
import cn from 'classnames'
import { CopyButton } from 'UI'
function HighlightCode({ className = 'js', text = ''}) {
return (
<div className={stl.snippetWrapper}>
<CopyButton content={text} className={cn(stl.codeCopy, 'mt-2 mr-2')} />
<Highlight className={className}>
{text}
</Highlight>
</div>
)
}
export default HighlightCode