1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-10-23 10:46:13 +02:00

Highlight sample code

This commit is contained in:
Phuoc Nguyen
2019-11-15 16:31:03 +07:00
parent 3668a6ee3a
commit 73587005ff
4 changed files with 30 additions and 0 deletions

13
client/SampleCode.jsx Normal file
View File

@@ -0,0 +1,13 @@
import React from 'react';
import highlight from './helpers/highlight';
const SampleCode = ({ code, lang }) => {
return code === ''
? <></>
: (
<pre className="lh-copy mh0 mv3" dangerouslySetInnerHTML={{ __html: highlight(code, lang) }} />
);
};
export default SampleCode;