refactor: JSON editing for NoTrait

This commit is contained in:
cha0s 2021-01-27 14:15:26 -06:00
parent d7c93d591d
commit 00c1da7420

View File

@ -6,6 +6,7 @@ import {
React, React,
useLatus, useLatus,
} from '@latus/react'; } from '@latus/react';
import {JsonResourceController} from '@persea/json';
import { import {
Tab, Tab,
Tabs, Tabs,
@ -13,15 +14,12 @@ import {
TabPanel, TabPanel,
} from 'react-tabs'; } from 'react-tabs';
const NoTraitRenderer = ({json}) => ( const NoTraitRenderer = ({path, json}) => (
<pre> <JsonResourceController.Component path={path} resource={json} />
<code>
{JSON.stringify(json, null, 2)}
</code>
</pre>
); );
NoTraitRenderer.propTypes = { NoTraitRenderer.propTypes = {
path: PropTypes.string.isRequired,
json: PropTypes.shape({}).isRequired, json: PropTypes.shape({}).isRequired,
}; };