import React from 'react';
import classNames from 'classnames';
import { Button } from 'antd';
import Iconfont from "../../../iconfont";
import "./index.less";
var prefix = 'pisell-lowcode-';
var Action = function Action(_ref) {
  var item = _ref.item,
    onAction = _ref.onAction;
  var renderIcon = function renderIcon() {
    var actionIcon = item.actionIcon;
    if (actionIcon && typeof actionIcon === 'string') {
      return /*#__PURE__*/React.createElement(Iconfont, {
        type: actionIcon,
        style: {
          fontSize: 20
        }
      });
    }
    return null;
  };
  return /*#__PURE__*/React.createElement("div", {
    className: classNames("".concat(prefix, "product-actions"))
  }, /*#__PURE__*/React.createElement(Button, {
    className: classNames("".concat(prefix, "product-actions-item")),
    size: "large",
    onClick: function onClick(e) {
      e.preventDefault();
      e.stopPropagation();
      onAction();
    }
  }, renderIcon(), item.actionText));
};
export default Action;