import { getText } from "../../locales/index.js";
import PisellModal from "../pisellModal/index.js";
import React, { useEffect, useRef, useState } from "react";
import { Button, Divider, QRCode } from "antd";
import classNames from "classnames";
import "./index.less";
//#region src/components/pisellQrcode/index.tsx
const PisellQrcode = (props) => {
	const { size, platform, value = "", className } = props;
	const [open, setOpen] = useState(false);
	useEffect(() => {
		document.body.id = "body";
	}, []);
	useRef(null);
	useEffect(() => {
		if (open) {}
	}, [open]);
	const modalProps = {
		title: getText("pisellQrcode-qrcode"),
		platform,
		onCancel: () => setOpen(false),
		open,
		footer: null,
		mobileModalHeight: "auto",
		className: classNames("pisell-qrcode-modal"),
		bodyStyle: { padding: 0 }
	};
	return /* @__PURE__ */ React.createElement("div", { className: classNames("pisell-qrcode-wrapper", className) }, /* @__PURE__ */ React.createElement("div", { onClick: (e) => {
		e.stopPropagation();
		setOpen(true);
	} }, /* @__PURE__ */ React.createElement(QRCode, {
		size,
		value,
		bordered: false
	})), /* @__PURE__ */ React.createElement(PisellModal, modalProps, /* @__PURE__ */ React.createElement(QRCode, {
		size: 200,
		value,
		style: { marginTop: 24 }
	}), /* @__PURE__ */ React.createElement("p", { className: classNames("pisell-qrcode-modal-value") }, value), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(Button, {
		onClick: () => setOpen(false),
		className: classNames("pisell-qrcode-modal-button")
	}, getText("pisellQrcode-done"))));
};
//#endregion
export { PisellQrcode as default };
