import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { useRequest } from "../hooks.js";
import { useState } from "react";
//#region src/components/eftpos/PairModal/hooks.ts
const usePairModal = () => {
	const [visible, setVisible] = useState(false);
	const [modalProps, setModalProps] = useState({});
	const open = (props) => {
		setModalProps(_objectSpread2(_objectSpread2({}, props || {}), {}, {
			visible: true,
			close
		}));
		setVisible(true);
	};
	const close = () => {
		setVisible(false);
		setModalProps({});
	};
	return {
		visible,
		open,
		close,
		modalProps
	};
};
/**
* @title 解除配对
*/
const useUnPairRequest = () => {
	const request = useRequest();
	const run = (params) => {
		return request.post("/shop/pay/card-reader/unpair", params, {});
	};
	return { run };
};
/**
* @title 检查配对状态
*/
const useCheckPairRequest = () => {
	const request = useRequest();
	const run = (params) => {
		return request.post("/shop/pay/card-reader/pairing-info", params, {});
	};
	return { run };
};
//#endregion
export { useCheckPairRequest, usePairModal, useUnPairRequest };
