summaryrefslogtreecommitdiff
path: root/frontend/src/components/app/sidebars/topology/machine/UnitListComponent.js
blob: 2ade0f6a5e76ef6925d4235158849df6b5675ea0 (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/app/sidebars/topology/machine/UnitContainer'

const UnitListComponent = ({ unitType, unitIds }) => (
    <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">
                <span>
                    <strong>No units...</strong> Add some with the menu above!
                </span>
            </div>
        )}
    </ul>
)

export default UnitListComponent