require("../../../../../../../../_virtual/_rolldown/runtime.js");
const require_state = require("../../state.js");
const require_utils = require("../../../../utils.js");
const require_index = require("../../Item/index.js");
let react = require("react");
let antd = require("antd");
let _pisell_materials = require("@pisell/materials");
require("./index.less");
//#region src/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.tsx
const WeekItem = (props) => {
	const { weekList, currentDate, setCurrentDate, isActive, productId, dateLimitData, getLimitData, cutTime } = props;
	const [monthIndex, setMonthIndex] = (0, react.useState)([]);
	(0, react.useEffect)(() => {
		if (isActive && productId) {}
	}, [
		isActive,
		productId,
		weekList
	]);
	(0, react.useEffect)(() => {
		setMonthIndex(require_utils.getMonthIndex(weekList));
	}, [weekList]);
	return /* @__PURE__ */ React.createElement("div", { className: "week-item-wrap" }, /* @__PURE__ */ React.createElement("div", { className: "week-item-content" }, /* @__PURE__ */ React.createElement(_pisell_materials.Iconfont, {
		type: "pisell2-arrow-left",
		className: "week-item__icon"
	}), /* @__PURE__ */ React.createElement(antd.Space, { size: 8 }, weekList === null || weekList === void 0 ? void 0 : weekList.map((item, index) => {
		const { disabled, currentStatus } = require_utils.getCurrentStatus(dateLimitData, item, cutTime);
		return /* @__PURE__ */ React.createElement(require_index.default, {
			key: index,
			date: require_utils.formatDate(item, "DD"),
			week: require_state.weekListText[index],
			dateText: item,
			disabled,
			status: currentStatus,
			select: currentDate === item,
			showMonth: monthIndex.includes(index),
			onClick: (e) => {
				setCurrentDate(item);
			}
		});
	})), /* @__PURE__ */ React.createElement(_pisell_materials.Iconfont, {
		type: "pisell2-arrow-right",
		className: "week-item__icon"
	})));
};
//#endregion
exports.default = WeekItem;
