var CourseCalendar, CourseMonth, React, displayAs, moment;
moment = require('moment');
React = require('react');
CourseMonth = require('./month');
displayAs = {
month: CourseMonth
};
CourseCalendar = React.createClass({
displayName: 'CourseCalendar',
propTypes: {
loadPlansList: React.PropTypes.func
},
getInitialState: function() {
return {
displayAs: 'month'
};
},
render: function() {
var Handler, loadPlansList, plansList;
Handler = displayAs[this.state.displayAs];
loadPlansList = this.props.loadPlansList;
plansList = typeof loadPlansList === "function" ? loadPlansList() : void 0;
return React.createElement(Handler, React.__spread({}, this.props, {
"plansList": plansList,
"ref": 'calendarHandler'
}));
}
});
module.exports = CourseCalendar;
|