const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_index = require("../../store/index.js");
const require_payLog = require("../../utils/payLog.js");
const require_index$1 = require("../header/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
//#region src/components/eftposPay/component/signature/index.tsx
/**
* @title: 取消签名确认页
* @Author: hongbing.wang
* @Date: 2024-08-20 11:49
*/
var signature_default = ({ api, className = "" }) => {
	const dispatch = require_index.useDispatch();
	const { number, mode } = require_index.useContextData();
	const [disabled, setDisabled] = (0, react.useState)(false);
	/**
	* @title: 返回流程页
	* @Author: hongbing.wang
	* @Date: 2024-08-20 11:51
	*/
	const onBack = () => {
		require_payLog.default.log("取消签名确认页：点击返回");
		dispatch(require_index.updateComponent(""));
	};
	/**
	* @title: 取消签名确认页
	* @Author: hongbing.wang
	* @Date: 2024-08-20 11:51
	*/
	const onConfirm = () => {
		require_payLog.default.log("取消签名确认页：点击确认");
		setDisabled(true);
		api.update({
			type: "NO",
			number
		}).then(() => {
			setDisabled(false);
			dispatch(require_index.updateComponent(""));
			dispatch(require_index.updateNextStep());
		}).catch((res) => {
			setDisabled(false);
			console.log(res);
		});
	};
	return /* @__PURE__ */ react.default.createElement("div", { className: `pisell-lowcode__eft-pay-box ${className}` }, /* @__PURE__ */ react.default.createElement(require_index$1.default, { status: "warn" }), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__eft-pay-fail-title" }, _pisell_utils.locales.getText("page.eftpos-pay.text.signature.title")), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__eft-pay-warn-text pisell-lowcode__eft-pay-body" }, _pisell_utils.locales.getText("page.eftpos-pay.text.signature.text")(mode)), /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ react.default.createElement(antd.Button, {
		block: true,
		className: "pisell-lowcode__eft-pay-step-item-btn",
		onClick: onBack
	}, _pisell_utils.locales.getText("page.eftpos-pay.text.back")), /* @__PURE__ */ react.default.createElement(antd.Button, {
		block: true,
		className: "pisell-lowcode__eft-pay-step-item-btn",
		type: "primary",
		onClick: onConfirm,
		disabled
	}, _pisell_utils.locales.getText("page.eftpos-pay.text.confirm.decline"))));
};
//#endregion
exports.default = signature_default;
