import React from "react";
import { image } from "@pisell/utils";
import XClose from "@pisell/icon/es/XClose";
import classNames from "classnames";
import "./index.less";
var ProductItemPreview = function ProductItemPreview(_ref) {
  var _ref$item = _ref.item,
    item = _ref$item === void 0 ? {} : _ref$item,
    _onClick = _ref.onClick,
    onRemove = _ref.onRemove,
    _ref$amountSymbol = _ref.amountSymbol,
    amountSymbol = _ref$amountSymbol === void 0 ? "$" : _ref$amountSymbol,
    style = _ref.style,
    className = _ref.className;
  return /*#__PURE__*/React.createElement("div", {
    style: style,
    className: classNames("product-item-card-preview", className),
    onClick: function onClick() {
      _onClick(item);
    }
  }, item.cover ? /*#__PURE__*/React.createElement("img", {
    src: image.ali(item.cover, 100),
    className: "product-item-card-preview-cover"
  }) : null, /*#__PURE__*/React.createElement("div", {
    className: "product-item-card-preview-content"
  }, /*#__PURE__*/React.createElement("div", {
    className: "product-item-card-preview-title"
  }, item.title)), /*#__PURE__*/React.createElement("div", {
    className: "product-item-card-preview-close-wrap",
    onClick: function onClick(e) {
      e.preventDefault();
      e.stopPropagation();
      onRemove === null || onRemove === void 0 || onRemove(item);
    }
  }, /*#__PURE__*/React.createElement(XClose, {
    className: "product-item-card-preview-close"
  })));
};
export default ProductItemPreview;