diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-07 11:38:42 +0200 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-09-23 10:05:58 +0200 |
| commit | e9909159dc5db91eda12437e18c1474cae848af7 (patch) | |
| tree | f34e0ca56b666f6a4ab1022e58a6dcd84b779725 /src/components/sidebars/topology/rack/MachineListComponent.js | |
| parent | d5a92d3006561fd631279b68b23a1f8075b28bb8 (diff) | |
Implement first machine slot listing
Diffstat (limited to 'src/components/sidebars/topology/rack/MachineListComponent.js')
| -rw-r--r-- | src/components/sidebars/topology/rack/MachineListComponent.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/components/sidebars/topology/rack/MachineListComponent.js b/src/components/sidebars/topology/rack/MachineListComponent.js new file mode 100644 index 00000000..d8a31ddc --- /dev/null +++ b/src/components/sidebars/topology/rack/MachineListComponent.js @@ -0,0 +1,19 @@ +import React from "react"; +import EmptySlotContainer from "../../../../containers/sidebars/topology/rack/EmptySlotContainer"; +import MachineContainer from "../../../../containers/sidebars/topology/rack/MachineContainer"; + +const MachineListComponent = ({machineIds}) => { + return ( + <ul className="list-group"> + {machineIds.map((machineId, index) => { + if (machineId === null) { + return <EmptySlotContainer key={index} position={index}/>; + } else { + return <MachineContainer key={index} position={index} machineId={machineId}/>; + } + })} + </ul> + ); +}; + +export default MachineListComponent; |
