(props: { json: string; fnLabel?: string })
| 55 | }; |
| 56 | |
| 57 | const HighlightedJson = (props: { json: string; fnLabel?: string }) => { |
| 58 | let formattedJson = props.json; |
| 59 | |
| 60 | try { |
| 61 | formattedJson = JSON.stringify(JSON.parse(props.json), null, 2); |
| 62 | } catch (e) {} |
| 63 | |
| 64 | return ( |
| 65 | <VStack w="full" alignItems="flex-start" bgColor="gray.50" borderRadius={4}> |
| 66 | <SyntaxHighlighter |
| 67 | customStyle={{ |
| 68 | overflowX: "unset", |
| 69 | width: "100%", |
| 70 | flex: 1, |
| 71 | backgroundColor: "transparent", |
| 72 | fontSize: 14, |
| 73 | }} |
| 74 | language="javascript" |
| 75 | lineProps={{ |
| 76 | style: { wordBreak: "break-all", whiteSpace: "pre-wrap" }, |
| 77 | }} |
| 78 | wrapLines |
| 79 | > |
| 80 | {props.fnLabel ? `${props.fnLabel}(${formattedJson})` : formattedJson} |
| 81 | </SyntaxHighlighter> |
| 82 | </VStack> |
| 83 | ); |
| 84 | }; |
| 85 | |
| 86 | export default FormattedMessage; |
nothing calls this directly
no outgoing calls
no test coverage detected