import AllSchedules from "./AllSchedules/index.js";
import SchedulesForDay from "./SchedulesForDay/index.js";
import ScheduleDetailDrawer from "./ScheduleDetailDrawer/index.js";
import React, { useMemo } from "react";
import "./index.less";
//#region src/components/schedules/schedules/Schedules.tsx
/**
* 日程tab项
* @param props
* @constructor
*/
const Schedules = (props) => {
	const { type, detail, onClose, onOpenDetail, dataSource, loading, onCalendarDataChange, onDelete, currentSelectDayDetail, onCloseDay, schedulesForDaySlot, scheduleMap } = props;
	const { id, show, type: createType } = detail;
	const content = useMemo(() => {
		if (type === "all") return /* @__PURE__ */ React.createElement(AllSchedules, {
			onOpenDetail,
			dataSource,
			loading
		});
		else if (type === "forADay") return /* @__PURE__ */ React.createElement(SchedulesForDay, {
			onOpenDetail,
			dataSource,
			loading,
			currentSelectDayDetail,
			onCloseDay,
			slot: schedulesForDaySlot,
			scheduleMap
		});
		return null;
	}, [
		type,
		dataSource,
		loading,
		currentSelectDayDetail,
		schedulesForDaySlot,
		scheduleMap
	]);
	return /* @__PURE__ */ React.createElement(React.Fragment, null, content, /* @__PURE__ */ React.createElement(ScheduleDetailDrawer, {
		type: createType,
		scheduleId: id,
		open: show,
		onClose,
		onDelete,
		onCalendarDataChange
	}));
};
//#endregion
export { Schedules as default };
