const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_materials = require("@pisell/materials");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
//#region src/plus/saasDevice/appPeripheral/components/PrinterUsageModal.tsx
const usageOptions = ["label", "wristband"];
const PrinterUsageModal = ({ state, variant, submitting, getText, onClose, onSelect }) => {
	if (!state) return null;
	const isPhone = variant === "phone";
	return /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellModal, {
		open: true,
		title: getText("pisell2.saas.app-peripheral.print-usage-title"),
		headerDivider: false,
		footerDivider: false,
		okVisible: false,
		cancelText: getText("pisell2.saas.app-peripheral.cancel"),
		cancelButtonProps: {
			block: true,
			size: "large",
			type: "default",
			disabled: submitting,
			onClick: onClose
		},
		width: 520,
		platform: isPhone ? "h5" : void 0,
		mobileModalHeight: isPhone ? "auto" : void 0,
		className: (0, classnames.default)("saas-app-peripheral-usage-modal", { "saas-app-peripheral-usage-modal--phone": isPhone }),
		destroyOnClose: true,
		maskClosable: !submitting,
		onCancel: () => {
			if (submitting) return;
			onClose();
		}
	}, /* @__PURE__ */ react.default.createElement(antd.List, {
		className: "saas-app-peripheral-usage-modal__list",
		dataSource: usageOptions,
		renderItem: (usage) => /* @__PURE__ */ react.default.createElement(antd.List.Item, null, /* @__PURE__ */ react.default.createElement("div", {
			role: "button",
			tabIndex: submitting ? -1 : 0,
			"aria-disabled": submitting,
			className: (0, classnames.default)("saas-app-peripheral-usage-modal__option", { "is-disabled": submitting }),
			onClick: () => {
				if (submitting) return;
				onSelect(usage);
			},
			onKeyDown: (event) => {
				if (submitting) return;
				if (event.key === "Enter" || event.key === " ") {
					event.preventDefault();
					onSelect(usage);
				}
			}
		}, /* @__PURE__ */ react.default.createElement(_pisell_materials.Icon, { type: usage === "label" ? "TagOutlined" : "PrinterOutlined" }), /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("strong", null, getText(`pisell2.saas.app-peripheral.print-usage.${usage}`)), /* @__PURE__ */ react.default.createElement("span", null, getText(`pisell2.saas.app-peripheral.print-usage.${usage}-desc`)))))
	}));
};
//#endregion
exports.default = PrinterUsageModal;
