import React from 'react'
import StorageUnitInstance from './storageUnitInstance/storageUnitInstance'
import StorageContentUi from '../../ui3d/StorageContentUi';
import { useSceneContext } from '../../../scene/sceneContext';

function StorageUnitInstances() {
    const { storageUnitStore } = useSceneContext();
    const { storageUnits } = storageUnitStore();

    return (
        <>
            {storageUnits.map((storageUnit: StorageUnitStatus) => (
                <React.Fragment key={storageUnit.modelUuid}>
                    <StorageUnitInstance storageUnit={storageUnit} />
                    <StorageContentUi storageUnit={storageUnit} />
                </React.Fragment>
            ))}
        </>
    )
}

export default StorageUnitInstances