Files
SCM-Manager/scm-ui/ui-components/src/SyntaxHighlighter.tsx

26 lines
572 B
TypeScript
Raw Normal View History

import React from 'react';
2019-10-17 12:07:20 +02:00
import { LightAsync as ReactSyntaxHighlighter } from 'react-syntax-highlighter';
import { arduinoLight } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
type Props = {
language: string;
value: string;
};
class SyntaxHighlighter extends React.Component<Props> {
render() {
return (
<ReactSyntaxHighlighter
showLineNumbers="false"
language={this.props.language}
style={arduinoLight}
>
{this.props.value}
</ReactSyntaxHighlighter>
);
}
}
export default SyntaxHighlighter;