import React from 'react';
import OpenCard from "../../OpenCard";
import { locales } from '@pisell/utils';
import ScheduleCalendar from "../../scheduleCalendar";
import { useEventDetail, useInit } from "../../../../Sales";
var Schedule = function Schedule() {
  var _detail$selectDate;
  var _useInit = useInit(),
    initData = _useInit.initData;
  var _useEventDetail = useEventDetail(),
    detail = _useEventDetail.detail,
    getEventDetailSelectDate = _useEventDetail.getEventDetailSelectDate;
  return /*#__PURE__*/React.createElement(OpenCard, {
    title: locales.getText('pisell2.event.schedule'),
    showBorder: true,
    isClick: false,
    showArrow: false
  }, /*#__PURE__*/React.createElement(ScheduleCalendar, {
    showScheduleName: false,
    data: (detail === null || detail === void 0 || (_detail$selectDate = detail.selectDate) === null || _detail$selectDate === void 0 ? void 0 : _detail$selectDate.dates) || [],
    onChange: function onChange(e) {
      var _detail$introduction;
      var id = detail === null || detail === void 0 || (_detail$introduction = detail.introduction) === null || _detail$introduction === void 0 || (_detail$introduction = _detail$introduction._originData) === null || _detail$introduction === void 0 ? void 0 : _detail$introduction.id;
      if (!id) return;
      getEventDetailSelectDate.run(id, {
        days: 366,
        start_date: "".concat(e, "-01-01")
      });
    },
    type: initData === null || initData === void 0 ? void 0 : initData.scheduleDisplayType
  }));
};
export default Schedule;