const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
let _pisell_icon_es_PlusCircle = require("@pisell/icon/es/PlusCircle");
_pisell_icon_es_PlusCircle = require_runtime.__toESM(_pisell_icon_es_PlusCircle);
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
let _pisell_icon_es_ChevronRight = require("@pisell/icon/es/ChevronRight");
_pisell_icon_es_ChevronRight = require_runtime.__toESM(_pisell_icon_es_ChevronRight);
require("./index.less");
//#region src/components/booking/components/addButton/index.tsx
/**
* @title: 添加按钮,  两种状态切换
* @description:
* @return {*}
* @Author: zhiwei.Wang
* @Date: 2024-01-30 16:42
*/
const AddButton = ({ onClick, showSub, title, subTitle, style, disabled, loading, showDisabledMessage = true }) => {
	const _onClick = () => {
		if (disabled) {
			if (showDisabledMessage) antd.message.warning(_pisell_utils.locales.getText("pisell2.text.please-select-the-customer-first"));
		} else onClick === null || onClick === void 0 || onClick();
	};
	if (loading) return /* @__PURE__ */ react.default.createElement(antd.Skeleton, {
		style: { marginTop: 16 },
		loading: true,
		round: true,
		active: true
	});
	return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, showSub ? /* @__PURE__ */ react.default.createElement("div", {
		className: "pisell-lowcode__booking-add-button-add-row",
		onClick: _onClick,
		style: (0, _pisell_utils.isFunction)(style) ? style(showSub) : style
	}, /* @__PURE__ */ react.default.createElement(_pisell_icon_es_PlusCircle.default, { className: "pisell-lowcode__booking-add-button-add-row-icon" }), /* @__PURE__ */ react.default.createElement("span", { className: "pisell-lowcode__booking-add-button-add-row-txt" }, subTitle)) : /* @__PURE__ */ react.default.createElement("div", {
		className: (0, classnames.default)("pisell-lowcode__booking-add-button-add", { "pisell-lowcode__booking-add-button-add-disabled": disabled }),
		onClick: _onClick,
		style: (0, _pisell_utils.isFunction)(style) ? style(showSub) : style
	}, /* @__PURE__ */ react.default.createElement("span", { className: "pisell-lowcode__booking-add-button-add-label" }, title), /* @__PURE__ */ react.default.createElement(_pisell_icon_es_ChevronRight.default, { className: "pisell-lowcode__booking-add-button-add-icon" })));
};
//#endregion
exports.default = AddButton;
