const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_useComponents = require("../../../../hooks/useComponents.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
require("./index.less");
//#region src/plus/walletEditor/components/relationProduct/index.tsx
const RelationProduct = ({ value, onChange }) => {
	const linkerRef = (0, react.useRef)(null);
	const [RelationProduct] = require_useComponents.default({ components: ["RelationProduct"] });
	if (!(RelationProduct === null || RelationProduct === void 0 ? void 0 : RelationProduct.PassLinker)) return null;
	const onShow = () => {
		if (linkerRef.current) {
			var _linkerRef$current$op, _linkerRef$current;
			(_linkerRef$current$op = (_linkerRef$current = linkerRef.current).openModal) === null || _linkerRef$current$op === void 0 || _linkerRef$current$op.call(_linkerRef$current);
		}
	};
	return /* @__PURE__ */ react.default.createElement("div", { className: "product-detail-card-module" }, /* @__PURE__ */ react.default.createElement("div", { className: "linked-passes-empty-state" }, /* @__PURE__ */ react.default.createElement("p", { className: "linked-passes-description" }, _pisell_utils.locales.getText("linkedPassesDesc")), /* @__PURE__ */ react.default.createElement(antd.Button, {
		type: "primary",
		size: "large",
		onClick: onShow,
		className: "select-passes-button"
	}, _pisell_utils.locales.getText("selectPasses")), value && value.length > 0 ? /* @__PURE__ */ react.default.createElement("div", { style: { padding: 8 } }) : null, /* @__PURE__ */ react.default.createElement(RelationProduct.PassLinker, {
		ref: linkerRef,
		value,
		onChange
	})));
};
//#endregion
exports.default = RelationProduct;
