summaryrefslogtreecommitdiff
path: root/src/components/sidebars/topology/machine/UnitListComponent.js
blob: 307edc0a8af30944bdf11315e9e229cb53b83454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import React from "react";
import UnitContainer from "../../../../containers/sidebars/topology/machine/UnitContainer";

const UnitListComponent = ({unitType, unitIds, inSimulation}) => (
    <ul className="list-group mt-1">
        {unitIds.length !== 0 ?
            unitIds.map((unitId, index) => (
                <UnitContainer unitType={unitType} unitId={unitId} index={index} key={index}/>
            )) :
            <div className="alert alert-info">
                {inSimulation ?
                    <strong>No units of this type in this machine</strong> :
                    <span><strong>No units...</strong> Add some with the menu above!</span>
                }
            </div>
        }
    </ul>
);

export default UnitListComponent;