import { range } from 'lodash' import React from 'react' import { EntityUUID } from '@xrengine/common/src/interfaces/EntityUUID' import { Button } from '@xrengine/editor/src/components/inputs/Button' import InputGroup from '@xrengine/editor/src/components/inputs/InputGroup' import { SceneObjectInput } from '@xrengine/editor/src/components/inputs/SceneObjectInput' import PaginatedList from '@xrengine/editor/src/components/layout/PaginatedList' import Well from '@xrengine/editor/src/components/layout/Well' import NodeEditor from '@xrengine/editor/src/components/properties/NodeEditor' import { EditorComponentType, updateProperty } from '@xrengine/editor/src/components/properties/Util' import { getComponent } from '@xrengine/engine/src/ecs/functions/ComponentFunctions' import { LoadVolumeComponent, LoadVolumeTarget } from '@xrengine/engine/src/scene/components/LoadVolumeComponent' import CloudSyncIcon from '@mui/icons-material/CloudSync' import { Grid } from '@mui/material' const LoadVolumeNodeEditor: EditorComponentType = (props) => { const loadVolumeComponent = getComponent(props.entity, LoadVolumeComponent) const targets = loadVolumeComponent.targets /*function onEditTargets(index) { return (value) => { const nuTargets = [...targets.values()].map(({ uuid, entityJson, loaded }, i) => { if (i !== index) return [uuid, { uuid, entityJson, loaded }] return [value, { uuid: value }] }) as [EntityUUID, LoadVolumeTarget][] loadVolumeComponent.targets = new Map(nuTargets) } } function onAddTarget() { return () => { const nuTargets = [...targets.entries(), ['', {}] as [EntityUUID, LoadVolumeTarget]] loadVolumeComponent.targets = new Map(nuTargets) } } function onRemoveTarget(index) { return () => { const nuTargets = [...targets.entries()].filter((_, i) => i !== index) loadVolumeComponent.targets = new Map(nuTargets) } }*/ /* return ( { const { uuid } = targets[i] return ( ) }} /> )*/ return <> } LoadVolumeNodeEditor.iconComponent = CloudSyncIcon export default LoadVolumeNodeEditor