-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathcode.js
More file actions
36 lines (34 loc) · 689 Bytes
/
Copy pathcode.js
File metadata and controls
36 lines (34 loc) · 689 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from 'react';
function Code({
id = undefined,
children,
className = undefined,
escape = undefined,
fragment = false,
fragmentStyle = undefined,
fragmentIndex = undefined,
lineNumbers = undefined,
noTrim = undefined,
}) {
return (
<pre
data-id={id}
id={id}
data-fragment-index={fragmentIndex}
className={
className +
(fragment ? ' fragment' : '') +
(fragmentStyle ? ` ${fragmentStyle}` : '')
}
>
<code
data-noexcape={!escape}
data-trim={!noTrim}
data-line-numbers={lineNumbers}
>
{children.code}
</code>
</pre>
);
}
export default Code;