-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.jsx
More file actions
41 lines (37 loc) · 1.08 KB
/
index.jsx
File metadata and controls
41 lines (37 loc) · 1.08 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
import React, { Component, PropTypes } from 'react';
import map from 'lodash/map';
import isEmpty from 'lodash/isEmpty';
import Tabs from '../../../main/components/Tabs';
import Rooms from '../Rooms';
import Calendar from '../Calendar';
class Reservation extends Component {
constructor(props) {
super(props);
this.state = {
selected: '1',
};
}
render() {
const { infrastructure, blocks, days, data } = this.props;
const { selected } = this.state;
const rooms = !isEmpty(infrastructure) ? infrastructure[selected].rooms : {};
return (
<Tabs
list={infrastructure ? map(infrastructure, (item, key) => ({ key, name: item.name, icon: item.icon })) : []}
selected={selected}
>
<div>
<Rooms rooms={rooms} />
<Calendar blocks={blocks} days={days} data={data} />
</div>
</Tabs>
);
}
}
Reservation.propTypes = {
infrastructure: PropTypes.func.isRequired,
blocks: PropTypes.func.isRequired,
days: PropTypes.func.isRequired,
data: PropTypes.func.isRequired,
};
export default Reservation;