import React, { useCallback } from 'react' import { ValueGeneratorJSON, ValueGeneratorJSONDefaults } from '@xrengine/engine/src/scene/components/ParticleSystemComponent' import { State } from '@xrengine/hyperflux/functions/StateFunctions' import InputGroup from '../../inputs/InputGroup' import NumericInputGroup from '../../inputs/NumericInputGroup' import SelectInput from '../../inputs/SelectInput' import PaginatedList from '../../layout/PaginatedList' export default function ValueGenerator({ scope, value, onChange }: { scope: State value: ValueGeneratorJSON onChange: (key: string) => (value: any) => void }) { const onChangeType = useCallback(() => { const thisOnChange = onChange('type') return (type: typeof value.type) => { scope.set(ValueGeneratorJSONDefaults[type]) thisOnChange(type) } }, []) return (

{value.type === 'ConstantValue' && (
)} {value.type === 'IntervalValue' && (
)} {value.type === 'PiecewiseBezier' && (
} />
)}
) }