diff --git a/package.json b/package.json index 49ff19d99..c22650845 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ "react-final-form": "^6.5.9", "react-ga4": "^2.0.0", "react-pdf": "^7.3.3", + "react-syntax-highlighter": "^15.5.0", "react-virtualized-auto-sizer": "^1.0.11", "react-window": "^1.8.8", "recoil": "^0.1.2", diff --git a/src/libraries/ReactSyntaxHighlighter.res b/src/libraries/ReactSyntaxHighlighter.res new file mode 100644 index 000000000..c1ade91d2 --- /dev/null +++ b/src/libraries/ReactSyntaxHighlighter.res @@ -0,0 +1,26 @@ +type editorStyle + +@module("react-syntax-highlighter/dist/esm/styles/hljs") +external lightfair: editorStyle = "googlecode" + +type style = { + backgroundColor?: string, + lineHeight?: string, + fontSize?: string, + paddingLeft?: string, + padding?: string, +} + +module SyntaxHighlighter = { + @module("react-syntax-highlighter") @react.component + external make: ( + ~language: string=?, + ~style: editorStyle=?, + ~customStyle: style=?, + ~showLineNumbers: bool=?, + ~wrapLines: bool=?, + ~wrapLongLines: bool=?, + ~lineNumberContainerStyle: style=?, + ~children: string, + ) => React.element = "default" +} diff --git a/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res b/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res index f7644cf63..f16dcfb8a 100644 --- a/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res +++ b/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res @@ -48,15 +48,23 @@ module PrettyPrintJson = { {copyParsedJson} -
- {parsedJson->React.string} -- {copyParsedJson} -