mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
Add a Markdown component and a SyntaxHighlighter
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// @flow
|
||||
import React from "react";
|
||||
import ReactSyntaxHighlighter from "react-syntax-highlighter";
|
||||
import { arduinoLight } from "react-syntax-highlighter/dist/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;
|
||||
Reference in New Issue
Block a user