blob: 96f42a44247043b559e767b30561db3d31ac6a2d (
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
26
27
28
|
import React from 'react'
import { useDispatch, useSelector } from 'react-redux'
import {
cancelNewRoomConstruction,
finishNewRoomConstruction,
startNewRoomConstruction,
} from '../../../../../redux/actions/topology/building'
import StartNewRoomConstructionComponent from '../../../../../components/app/sidebars/topology/building/NewRoomConstructionComponent'
const NewRoomConstructionButton = (props) => {
const currentRoomInConstruction = useSelector((state) => state.construction.currentRoomInConstruction)
const dispatch = useDispatch()
const actions = {
onStart: () => dispatch(startNewRoomConstruction()),
onFinish: () => dispatch(finishNewRoomConstruction()),
onCancel: () => dispatch(cancelNewRoomConstruction()),
}
return (
<StartNewRoomConstructionComponent
{...props}
{...actions}
currentRoomInConstruction={currentRoomInConstruction}
/>
)
}
export default NewRoomConstructionButton
|