openreplay/frontend/app/components/ui/JSONTree/JSONTree.js
Shekar Siri 2ed5cac986
Webpack upgrade and dependency cleanup (#523)
* change(ui) - webpack update
* change(ui) - api optimize and other fixes
2022-06-03 16:47:38 +02:00

24 lines
No EOL
553 B
JavaScript

import React from 'react';
import JSONTree from 'react-json-view';
function updateObjectLink(obj) {
if (typeof obj !== 'object' || obj === null) return obj;
if (Array.isArray(obj)) return [ ...obj ];
return { ...obj }
}
export default ({ src, ...props }) => (
<JSONTree
name={ false }
collapsed={ 1 }
enableClipboard={ false }
iconStyle="circle"
indentWidth={ 1 }
sortKeys
displayDataTypes={ false }
displayObjectSize={ false }
src={ updateObjectLink(src) }
iconStle="triangle"
{ ...props }
/>
);