/** @format */

import * as React from 'react';
import {Empty} from 'antd';
import ReactJson from 'react-json-view-repair';
interface Iprops {
    src?: any;
    keyWord?: string;
}
const jsonView: React.FC<Iprops> = props => {
    const {src, keyWord} = props;
    if (!src) {
        return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />;
    }
    if (typeof src === 'object') {
        return (
            <ReactJson
                keyWord={keyWord || ''}
                src={src}
                displayDataTypes={false}
                name={false}
                displayObjectSize={false}
            />
        );
    }
    return src;
};
export default jsonView;
