import React, { Component } from 'react';
import { Calendar } from 'antd';
import './index.less';

class CalendarLayout extends Component {
  onSelect(selectedKeys, e) {
    if (this.props.onSelect) this.props.onSelect(selectedKeys, e);
  }

  render() {
    return (
      <div className="calendar-layout">
        <Calendar
          mode="year"
          onSelect={(selectedKeys, e) => this.onSelect(selectedKeys, e)}
          monthCellRender={this.props.monthCellRender}
        />
      </div>
    );
  }
}

export default CalendarLayout;
