mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-04-30 21:06:10 +00:00
* no message * change local api path * generic entry list item + rename files and vars * entry detailed generic * fix api file * clean warnings * switch * empty lines * fix scroll to end feature Co-authored-by: Roee Gadot <roee.gadot@up9.com>
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import {Prism as SyntaxHighlighterContainer} from 'react-syntax-highlighter';
|
|
import {highlighterStyle} from './highlighterStyle'
|
|
import './index.scss';
|
|
|
|
interface Props {
|
|
code: string;
|
|
style?: any;
|
|
showLineNumbers?: boolean;
|
|
className?: string;
|
|
language?: string;
|
|
isWrapped?: boolean;
|
|
}
|
|
|
|
export const SyntaxHighlighter: React.FC<Props> = ({
|
|
code,
|
|
style = highlighterStyle,
|
|
showLineNumbers = true,
|
|
className,
|
|
language = 'python',
|
|
isWrapped = false,
|
|
}) => {
|
|
return <div className={`highlighterContainer ${className ? className : ''} ${isWrapped ? 'wrapped' : ''}`}>
|
|
<SyntaxHighlighterContainer language={language} style={style} showLineNumbers={showLineNumbers}>
|
|
{code ?? ""}
|
|
</SyntaxHighlighterContainer>
|
|
</div>;
|
|
};
|
|
|
|
export default SyntaxHighlighter;
|