MCPcopy Create free account
hub / github.com/OpenPipe/OpenPipe / HighlightedJson

Function HighlightedJson

app/src/components/nodeEntries/FormattedMessage.tsx:57–84  ·  view source on GitHub ↗
(props: { json: string; fnLabel?: string })

Source from the content-addressed store, hash-verified

55};
56
57const 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
86export default FormattedMessage;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected