feat: Behaved start
This commit is contained in:
parent
d2f84a4be5
commit
74c71f36be
39
packages/entity/src/trait-components/behaved.jsx
Normal file
39
packages/entity/src/trait-components/behaved.jsx
Normal file
|
@ -0,0 +1,39 @@
|
|||
import {join} from 'path';
|
||||
|
||||
import {PropTypes, React} from '@latus/react';
|
||||
|
||||
import Expressions from '../behavior-components/expressions';
|
||||
|
||||
const Behaved = ({
|
||||
entity,
|
||||
json,
|
||||
path,
|
||||
}) => (
|
||||
<div className="behaved">
|
||||
<label>
|
||||
Routines
|
||||
{Object.entries(json.params.routines).map(([key, expressions]) => (
|
||||
<Expressions
|
||||
context={entity.context}
|
||||
expressions={expressions}
|
||||
path={join(path, 'params/routines', key)}
|
||||
/>
|
||||
))}
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
|
||||
Behaved.propTypes = {
|
||||
entity: PropTypes.shape({
|
||||
context: PropTypes.shape({}),
|
||||
}).isRequired,
|
||||
json: PropTypes.shape({
|
||||
params: PropTypes.shape({
|
||||
routines: PropTypes.shape({}),
|
||||
}),
|
||||
state: PropTypes.shape({}),
|
||||
}).isRequired,
|
||||
path: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export default Behaved;
|
Loading…
Reference in New Issue
Block a user