21 lines
374 B
TypeScript
21 lines
374 B
TypeScript
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>
|
|
);
|
|
}
|