import Dayjs from 'dayjs';
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
import classNames from 'classnames';
import "./index.less";
import { formatDate } from "../../../utils";
import DayItem from "./DayItem";
Dayjs.extend(isSameOrBefore);
var Item = function Item(props) {
  var date = props.date,
    status = props.status,
    disabled = props.disabled,
    select = props.select,
    _onClick = props.onClick,
    showMonth = props.showMonth,
    dateText = props.dateText,
    week = props.week;
  return /*#__PURE__*/React.createElement("div", {
    className: classNames('calendar-date-item', {
      disabledDate: disabled,
      disabledSelect: status === 'sold_out',
      selectDate: select
    }),
    onClick: function onClick() {
      return _onClick && _onClick(date);
    }
  }, showMonth && /*#__PURE__*/React.createElement("div", {
    className: "calendar-header-wrap"
  }, /*#__PURE__*/React.createElement("div", {
    className: classNames('current-month', 'current-year')
  }, formatDate(dateText, 'YYYY')), /*#__PURE__*/React.createElement("div", {
    className: 'current-month'
  }, formatDate(dateText, 'MMM'))), /*#__PURE__*/React.createElement(DayItem, {
    week: week,
    date: date,
    status: status
  }));
};
export default Item;