import IconFont from "../../../iconfont/index.js";
import React from "react";
import { Button } from "antd";
import classNames from "classnames";
import "./index.less";
//#region src/components/productCard/components/Action/index.tsx
const prefix = "pisell-lowcode-";
const Action = ({ item, onAction }) => {
	const renderIcon = () => {
		const { actionIcon } = item;
		if (actionIcon && typeof actionIcon === "string") return /* @__PURE__ */ React.createElement(IconFont, {
			type: actionIcon,
			style: { fontSize: 20 }
		});
		return null;
	};
	return /* @__PURE__ */ React.createElement("div", { className: classNames(`${prefix}product-actions`) }, /* @__PURE__ */ React.createElement(Button, {
		className: classNames(`${prefix}product-actions-item`),
		size: "large",
		onClick: (e) => {
			e.preventDefault();
			e.stopPropagation();
			onAction();
		}
	}, renderIcon(), item.actionText));
};
//#endregion
export { Action as default };
