const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_index = require("../../components/Search/index.js");
const require_index$1 = require("../../components/ScheduleList/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
require("./index.less");
//#region src/components/schedules/schedules/AllSchedules/index.tsx
/**
* 所有schedules列表
* @param props
* @constructor
*/
const AllSchedules = (props) => {
	const { onOpenDetail, dataSource, loading } = props;
	const [search, setSearch] = (0, react.useState)("");
	const showDataSource = (0, react.useMemo)(() => {
		return dataSource.filter((item) => item.name.toLowerCase().includes(search.toLowerCase()));
	}, [dataSource, search]);
	return /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__schedules-module-content-wrap" }, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__schedules-module-header" }, /* @__PURE__ */ react.default.createElement(require_index.default, {
		value: search,
		onChange: setSearch
	})), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__schedules-module-content" }, /* @__PURE__ */ react.default.createElement(require_index$1.default, {
		loading,
		dataSource: showDataSource,
		onItemClick: (item) => onOpenDetail === null || onOpenDetail === void 0 ? void 0 : onOpenDetail(item.id),
		showTabs: true
	})), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__schedules-module-add-button-wrap" }, /* @__PURE__ */ react.default.createElement(antd.Button, {
		className: "pisell-lowcode__schedules-module-add-button",
		onClick: () => onOpenDetail === null || onOpenDetail === void 0 ? void 0 : onOpenDetail(),
		size: "large",
		type: "primary",
		ghost: true
	}, _pisell_utils.locales.getText("pisell2.text.schedules.add"))));
};
//#endregion
exports.default = AllSchedules;
