import * as React from 'react'; import { LightAsync as SyntaxHighlighter } from 'react-syntax-highlighter'; import js from 'react-syntax-highlighter/dist/languages/hljs/javascript'; import { github } from 'react-syntax-highlighter/dist/styles/hljs'; import { CodeViewerProps } from './types'; SyntaxHighlighter.registerLanguage('javascript', js); export default class CodeViewer extends React.PureComponent { private renderItem(title: string, value): JSX.Element { return (

{title}: {value}

); } public render() { const { metaInfo: { platform, url, file, sessionId, }, testBody, } = this.props; return ( <>

Meta-info:

{this.renderItem('platform', platform)}

url: {url}

{this.renderItem('file', file)} {this.renderItem('sessionId', sessionId)}
{testBody || ''}
); } }