import React, {
	Component
} from 'react';
import {
	observer
} from 'mobx-react';
import {
	WeaDateSwitch,
	WeaRightMenu,
	WeaNewScroll
} from 'ecCom';
import CustomerCalendar from '../../../coms/Calendar';
import classnames from 'classnames';

@observer
export default class CalendarScheduling extends Component {
	constructor(props) {
		super(props);
	}

	componentDidMount() {}

	componentWillReceiveProps(nextProps) {}

	render() {
		const {
			store,
			rightMenu
		} = this.props;
		const {
			containerInitFinished,
			setDateSwitch,
			calendarType,
			currentDay,
			dateSwitchTypeList,
			onDateSwitchChange,
			getCalendarData
		} = store;
		const className = classnames({
			['calendarScheduling']: true,
			['tabPane']: true,
			['tabPane-include']: containerInitFinished.detachable
		})

		return (
			<div className={className}>
				<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@xpuy3y`} datas={rightMenu}>
					<div className='dateSwitch'>
						<WeaDateSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaDateSwitch@aexhwp`} onChange={onDateSwitchChange} typeList={dateSwitchTypeList} currentType={calendarType} currentDay={currentDay}/>
						<span className='icon-coms-Refresh' onClick={getCalendarData}/>
					</div>
					<div className='calendar'>
						<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@oxqsoa`} height={'100%'}>
							<CustomerCalendar ecId={`${this && this.props && this.props.ecId || ''}_CustomerCalendar@a2lj61`} store={store} />
						</WeaNewScroll>
					</div>
				</WeaRightMenu>
			</div>
		)
	}
}