mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-03 20:15:52 +01:00
use reflow to migrate from flow to typescript
This commit is contained in:
25
scm-ui/ui-components/src/SyntaxHighlighter.tsx
Normal file
25
scm-ui/ui-components/src/SyntaxHighlighter.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
|
||||
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;
|
||||
Reference in New Issue
Block a user