From c47a27b826f7d76410308a4151611a366f9eaf46 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Fri, 25 Aug 2017 17:48:12 +0200 Subject: Fetch and display datacenter topology --- src/components/map/groups/DatacenterGroup.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/components/map/groups/DatacenterGroup.js') diff --git a/src/components/map/groups/DatacenterGroup.js b/src/components/map/groups/DatacenterGroup.js index 3b7a086b..d7e349be 100644 --- a/src/components/map/groups/DatacenterGroup.js +++ b/src/components/map/groups/DatacenterGroup.js @@ -1,14 +1,20 @@ import React from "react"; import {Group} from "react-konva"; +import Shapes from "../../../shapes/index"; import RoomGroup from "./RoomGroup"; -const DatacenterGroup = ({datacenter}) => ( - - {datacenter.rooms.map(room => ( - - ))} - -); +const DatacenterGroup = ({datacenter}) => { + if (!datacenter) { + return ; + } + return ( + + {datacenter.rooms.map(room => ( + + ))} + + ); +}; DatacenterGroup.propTypes = { datacenter: Shapes.Datacenter, -- cgit v1.2.3