blob: 179a24a29a3a81829d52f538ea5456b8d315c515 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import React from "react";
import {Group} from "react-konva";
import Shapes from "../../../shapes/index";
import {deriveWallLocations} from "../../../util/tile-calculations";
import WallSegment from "../elements/WallSegment";
import TileGroup from "./TileGroup";
const RoomGroup = ({room, onClick}) => (
<Group
onClick={onClick}
>
{room.tiles.map(tile => (
<TileGroup key={tile.id} tile={tile}/>
))}
{deriveWallLocations(room).map((wallSegment, index) => (
<WallSegment key={index} wallSegment={wallSegment}/>
))}
</Group>
);
RoomGroup.propTypes = {
room: Shapes.Room,
};
export default RoomGroup;
|