const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let antd = require("antd");
//#region src/components/qrcode/index.tsx
const QRCode = (props) => {
	const { preview } = props;
	const [visible, setVisible] = react.default.useState(false);
	const id = (0, react.useMemo)(() => {
		return (0, _pisell_utils.getUniqueId)();
	}, []);
	const handleClick = (e) => {
		e.stopPropagation();
		setVisible(true);
	};
	return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("span", {
		onClick: handleClick,
		id,
		className: "pisell-lowcode-qrcode-wrap"
	}, /* @__PURE__ */ react.default.createElement(antd.QRCode, props)), preview && /* @__PURE__ */ react.default.createElement("span", { onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ react.default.createElement(antd.Modal, {
		open: visible,
		onCancel: () => setVisible(false),
		footer: null,
		width: 248,
		closeIcon: /* @__PURE__ */ react.default.createElement("span", null)
	}, /* @__PURE__ */ react.default.createElement(antd.QRCode, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, props), {}, { size: 200 })))));
};
//#endregion
exports.default = QRCode;
