const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.js");
const require_index = require("../ScheduleTimeItem/index.js");
let dayjs = require("dayjs");
dayjs = require_runtime.__toESM(dayjs);
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_materials = require("@pisell/materials");
require("./index.less");
//#region src/components/eventBooking/components/scheduleCalendar/components/ScheduleTimes/index.tsx
const ScheduleTimes = ({ month, schedulesData }) => {
	const [timeList, setTimeList] = (0, react.useState)([]);
	(0, react.useEffect)(() => {
		const timeList = [];
		for (const item of schedulesData) {
			const date = (0, dayjs.default)(item.date);
			if (date.isAfter(month, "month")) break;
			if (date.isSame(month, "month")) timeList.push(...(item === null || item === void 0 ? void 0 : item.times) || []);
		}
		if ((timeList === null || timeList === void 0 ? void 0 : timeList.length) > 0) setTimeList(timeList);
		else setTimeList([]);
	}, [month, schedulesData]);
	return /* @__PURE__ */ react.default.createElement("div", { className: "schedule-times-container" }, (timeList === null || timeList === void 0 ? void 0 : timeList.length) > 0 ? /* @__PURE__ */ react.default.createElement(require_index.default, {
		key: month,
		timeList
	}) : /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellEmpty, null));
};
//#endregion
exports.default = ScheduleTimes;
