feat(json-viewer): create to view json data
This commit is contained in:
parent
4e1ab7e9c2
commit
cfadae4df3
20
src/client/dd-hub-react/src/common/json-viewer.tsx
Normal file
20
src/client/dd-hub-react/src/common/json-viewer.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
|
||||
type JsonViewerProps = {
|
||||
data: any;
|
||||
};
|
||||
|
||||
export function JsonViewer({ data }: JsonViewerProps) {
|
||||
console.log (JSON.stringify(data));
|
||||
return (
|
||||
<pre style={{
|
||||
backgroundColor: '#f4f4f4',
|
||||
padding: '1rem',
|
||||
borderRadius: '5px',
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
}}>
|
||||
{JSON.stringify(data)}
|
||||
</pre>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user