"use strict";

require("./demo7.css");

var _ = _interopRequireDefault(require(".."));

var _react = _interopRequireDefault(require("react"));

var _reactDom = _interopRequireDefault(require("react-dom"));

var _dayjs = _interopRequireDefault(require("dayjs"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var currentDate = (0, _dayjs["default"])();

function dateCellRender(date) {
  var dateNum = date.date();

  if (currentDate.month() !== date.month()) {
    return dateNum;
  }

  var eventList;

  switch (dateNum) {
    case 1:
      eventList = [{
        type: 'primary',
        content: 'Event 1'
      }, {
        type: 'normal',
        content: 'Event 2'
      }];
      break;

    case 10:
      eventList = [{
        type: 'normal',
        content: 'Event 3'
      }, {
        type: 'normal',
        content: 'Event 4'
      }];
      break;

    case 11:
      eventList = [{
        type: 'primary',
        content: 'Event 5'
      }, {
        type: 'primary',
        content: 'Event 6'
      }];
      break;

    default:
      eventList = [];
  }

  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "custom-calendar-cell"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "custom-calendar-cell-value"
  }, dateNum), /*#__PURE__*/_react["default"].createElement("div", {
    className: "custom-calendar-cell-content"
  }, /*#__PURE__*/_react["default"].createElement("ul", {
    className: "event-list"
  }, eventList.map(function (item, key) {
    return /*#__PURE__*/_react["default"].createElement("li", {
      className: "".concat(item.type, "-event"),
      key: key
    }, item.content);
  }))));
}

function monthCellRender(date) {
  if (currentDate.month() === date.month()) {
    return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", null, date.month()), /*#__PURE__*/_react["default"].createElement("div", null, "Events"));
  }

  return date.month();
}

_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(_["default"], {
  dateCellRender: dateCellRender,
  monthCellRender: monthCellRender
}), document.getElementById('calendar2-demo-7'));