const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_asyncToGenerator = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
let _ant_design_icons = require("@ant-design/icons");
require("./index.less");
//#region src/components/booking/components/reloadResourceModal/index.tsx
const ReloadResourceModal = ({ modal, onReload, onCancel }) => {
	var _modal$state$service;
	const [loading, setLoading] = (0, react.useState)(false);
	const handleReload = function() {
		var _ref = require_asyncToGenerator._asyncToGenerator(function* () {
			setLoading(true);
			try {
				yield onReload === null || onReload === void 0 ? void 0 : onReload();
			} catch (_unused) {}
			setLoading(false);
		});
		return function handleReload() {
			return _ref.apply(this, arguments);
		};
	}();
	return /* @__PURE__ */ react.default.createElement(antd.Modal, {
		className: "pisell-resource-reload-modal",
		title: /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement(_ant_design_icons.WarningOutlined, { style: {
			color: "#d89614",
			marginRight: 8
		} }), _pisell_utils.locales.getText("pisell2.booking.info.resource.warning-title")),
		cancelText: null,
		okText: _pisell_utils.locales.getText("pisell2.booking.info.resource.retry"),
		confirmLoading: loading,
		open: (_modal$state$service = modal.state.service) === null || _modal$state$service === void 0 ? void 0 : _modal$state$service.reloadResourceModal,
		onOk: handleReload,
		cancelButtonProps: { style: { display: "none" } },
		onCancel
	}, /* @__PURE__ */ react.default.createElement("div", null, _pisell_utils.locales.getText("pisell2.booking.info.resource.warning-content")));
};
//#endregion
exports.default = ReloadResourceModal;
