summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/topologies/map/groups/WallGroup.js
blob: 6cbd1cd072fc436d89f6fc55e2bb125e676f1b7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import PropTypes from 'prop-types'
import React from 'react'
import { Group } from 'react-konva'
import { Tile } from '../../../../shapes'
import { deriveWallLocations } from '../../../../util/tile-calculations'
import WallSegment from '../elements/WallSegment'

function WallGroup({ tiles }) {
    return (
        <Group>
            {deriveWallLocations(tiles).map((wallSegment, index) => (
                <WallSegment key={index} wallSegment={wallSegment} />
            ))}
        </Group>
    )
}

WallGroup.propTypes = {
    tiles: PropTypes.arrayOf(Tile).isRequired,
}

export default WallGroup