import React from 'react'
import StorageUnitInstance from './storageUnitInstance/storageUnitInstance'
import { useStorageUnitStore } from '../../../../store/simulation/useStorageUnitStore'
import StorageContentUi from '../../ui3d/StorageContentUi';

function StorageUnitInstances() {
    const { storageUnits } = useStorageUnitStore();

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

export default StorageUnitInstances