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