diff --git a/packages/entity/src/trait-components/emitter.jsx b/packages/entity/src/trait-components/emitter.jsx index 753798d..aef863f 100644 --- a/packages/entity/src/trait-components/emitter.jsx +++ b/packages/entity/src/trait-components/emitter.jsx @@ -4,28 +4,45 @@ import { memo, PropTypes, React, + useLatus, } from '@latus/react'; +import { + JsonTabs, +} from '@persea/json'; import Particle from './emitter/particle'; const Emitter = memo(({ entity, - json: {params: {particles}}, + json, path, -}) => ( -
- { - Object.keys(particles).map((key) => ( - - )) - } -
-)); +}) => { + const latus = useLatus(); + const {Emitted} = latus.get('%traits'); + return ( +
+ ( + + )} + defaultValue={{ + rate: 0, + count: 1, + traits: { + Emitted: Emitted.withDefaults({}), + }, + }} + path={join(path, 'params/particles')} + map={json.params.particles} + /> +
+ ); +}); Emitter.displayName = 'Emitter';