JsonResult.tsx (527B)
1 import type { ReactNode } from "react"; 2 import { JsonView, darkStyles, allExpanded } from "react-json-view-lite"; 3 import "react-json-view-lite/dist/index.css"; 4 5 interface JsonResultProps { 6 data: unknown; 7 } 8 9 /** Renders JSON data as an interactive collapsible tree with dark theme. */ 10 export function JsonResult({ data }: JsonResultProps): ReactNode { 11 return ( 12 <div data-testid="json-tree" className="rounded"> 13 <JsonView data={data as object} style={darkStyles} shouldExpandNode={allExpanded} /> 14 </div> 15 ); 16 }