import { useInit } from "../../../../Sales/Init/index.js";
import { useEventDetail } from "../../../../Sales/Event/Detail.js";
import OpenCard_default from "../../OpenCard/index.js";
import EventScheduleCalendar from "../../scheduleCalendar/index.js";
import React from "react";
import { locales } from "@pisell/utils";
//#region src/components/eventBooking/components/bookingDetailModal/components/Schedule.tsx
const Schedule = () => {
	var _detail$selectDate;
	const { initData } = useInit();
	const { detail, getEventDetailSelectDate } = useEventDetail();
	return /* @__PURE__ */ React.createElement(OpenCard_default, {
		title: locales.getText("pisell2.event.schedule"),
		showBorder: true,
		isClick: false,
		showArrow: false
	}, /* @__PURE__ */ React.createElement(EventScheduleCalendar, {
		showScheduleName: false,
		data: (detail === null || detail === void 0 || (_detail$selectDate = detail.selectDate) === null || _detail$selectDate === void 0 ? void 0 : _detail$selectDate.dates) || [],
		onChange: (e) => {
			var _detail$introduction;
			const 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: `${e}-01-01`
			});
		},
		type: initData === null || initData === void 0 ? void 0 : initData.scheduleDisplayType
	}));
};
//#endregion
export { Schedule as default };
