import React, { useCallback } from "react";
import { Button, Popconfirm, Tooltip } from "antd";
import { CopyOutlined, DeleteOutlined, LockOutlined, UnlockOutlined } from "@ant-design/icons";
import classNames from "classnames";
//#region src/components/pisellFloorMapLayout/components/FloorMapEditQuickActions.tsx
/**
* 编辑态选中图元旁的快捷操作：锁定 / 复制 / 删除（与侧栏同源逻辑）
*/
const PREFIX = "pisell-floor-map-layout";
function FloorMapEditQuickActions(props) {
	const { className, labels, isLocked, onToggleLock, onDuplicate, onDelete, viewportScale = 1 } = props;
	const stopBubble = useCallback((e) => {
		e.stopPropagation();
	}, []);
	const safeScale = Math.max(viewportScale, .01);
	const inv = 1 / safeScale;
	const gap = 10 / safeScale;
	return /* @__PURE__ */ React.createElement("div", {
		role: "toolbar",
		"aria-label": labels.ariaToolbar,
		className: classNames(`${PREFIX}-edit-quick-actions`, isLocked && `${PREFIX}-edit-quick-actions--locked`, className),
		style: {
			transform: `translate(-50%, ${gap}px) scale(${inv})`,
			transformOrigin: "top center"
		},
		onPointerDown: (e) => e.stopPropagation()
	}, /* @__PURE__ */ React.createElement(Tooltip, { title: isLocked ? labels.unlock : labels.lock }, /* @__PURE__ */ React.createElement(Button, {
		type: "text",
		size: "large",
		icon: isLocked ? /* @__PURE__ */ React.createElement(LockOutlined, null) : /* @__PURE__ */ React.createElement(UnlockOutlined, null),
		onClick: (e) => {
			stopBubble(e);
			onToggleLock();
		},
		"aria-pressed": isLocked
	})), /* @__PURE__ */ React.createElement(Tooltip, { title: labels.duplicate }, /* @__PURE__ */ React.createElement(Button, {
		type: "text",
		size: "large",
		icon: /* @__PURE__ */ React.createElement(CopyOutlined, null),
		onClick: (e) => {
			stopBubble(e);
			onDuplicate();
		}
	})), /* @__PURE__ */ React.createElement(Popconfirm, {
		title: labels.popTitle,
		description: labels.popDesc,
		onConfirm: () => onDelete(),
		okText: labels.okDelete,
		cancelText: labels.cancel,
		okButtonProps: { danger: true }
	}, /* @__PURE__ */ React.createElement(Tooltip, { title: labels.delete }, /* @__PURE__ */ React.createElement(Button, {
		type: "text",
		danger: true,
		size: "large",
		icon: /* @__PURE__ */ React.createElement(DeleteOutlined, null),
		onClick: stopBubble
	}))));
}
//#endregion
export { FloorMapEditQuickActions };
