From 72d3550ce8500f8b46ee3360036ebe2996dc6930 Mon Sep 17 00:00:00 2001 From: Rajeev J Sebastian Date: Tue, 4 Mar 2025 20:44:10 +0530 Subject: [PATCH] Replace custom HTML with a JSON view --- .../components/nodes/NodeOutputDisplay.tsx | 29 +++---------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/frontend/src/components/nodes/NodeOutputDisplay.tsx b/frontend/src/components/nodes/NodeOutputDisplay.tsx index eae00fac..dc3155ee 100644 --- a/frontend/src/components/nodes/NodeOutputDisplay.tsx +++ b/frontend/src/components/nodes/NodeOutputDisplay.tsx @@ -4,6 +4,9 @@ import SyntaxHighlighter from 'react-syntax-highlighter/dist/cjs/prism' import { oneDark } from 'react-syntax-highlighter/dist/cjs/styles/prism' import { Icon } from '@iconify/react' +import JsonView from 'react18-json-view' +import 'react18-json-view/src/style.css' + interface NodeOutputDisplayProps { output: Record } @@ -143,31 +146,7 @@ const NodeOutputDisplay: React.FC = ({ output }) => { const renderJsonObject = (obj: Record) => { return (
- {Object.entries(obj).map(([key, val]) => ( -
-
{key}:
-
{renderValue(val)}
-
- -
-
- ))} +
) }