* start frontend thinning * continue thinning * removing moment and moment-range * remove highlightjs * remove semantic-ui * ghaida commits to openreplay finally * unused icons * unused icons * unused icons * fix missing icons --------- Co-authored-by: Ghaida Bouchaala <ghaida.bouchaala@gmail.com>
20 lines
No EOL
375 B
TypeScript
20 lines
No EOL
375 B
TypeScript
import React, { useEffect } from "react";
|
|
import Prism from "prismjs";
|
|
|
|
interface IProps {
|
|
code: string;
|
|
language: string;
|
|
}
|
|
|
|
const CodeBlock = ({ code, language }: IProps) => {
|
|
useEffect(() => {
|
|
Prism.highlightAll(false);
|
|
}, []);
|
|
return (
|
|
<pre>
|
|
<code children={code} className={`language-${language}`} />
|
|
</pre>
|
|
);
|
|
};
|
|
|
|
export default CodeBlock; |