import React from 'react';
import { Trash01 } from '@pisell/icon';
import { Iconfont } from '@pisell/materials';
import { locales } from '@pisell/utils';
import "./index.less";
import CompensatedPisellContainer from "../../../../pro/compensatedPisellContainer";
import { withResponsive } from "../../../../responsive";
var ClearCartModal = function ClearCartModal(_ref) {
  var visible = _ref.visible,
    onCancel = _ref.onCancel,
    onClearItemsOnly = _ref.onClearItemsOnly,
    onClearAllAndReset = _ref.onClearAllAndReset,
    variant = _ref.variant;
  var isPhoneVariant = variant === 'phone';
  return /*#__PURE__*/React.createElement(CompensatedPisellContainer, {
    renderType: isPhoneVariant ? 'drawer' : 'modal',
    showHandlerBar: isPhoneVariant,
    onHandlerBarClick: onCancel,
    props: isPhoneVariant ? {
      open: visible,
      placement: 'bottom',
      width: '100%',
      height: 'auto',
      onClose: onCancel,
      footer: null,
      className: 'pisell-clear-cart-modal',
      title: null
    } : {
      open: visible,
      onCancel: onCancel,
      footer: null,
      width: 520,
      centered: true,
      className: 'pisell-clear-cart-modal',
      title: null,
      closable: true
    }
  }, /*#__PURE__*/React.createElement("div", {
    className: "pisell-clear-cart-modal-content"
  }, /*#__PURE__*/React.createElement("h3", {
    className: "pisell-clear-cart-modal-title"
  }, locales.getText('pisell2.clear-cart-modal.title')), /*#__PURE__*/React.createElement("div", {
    className: "pisell-clear-cart-modal-options"
  }, /*#__PURE__*/React.createElement("button", {
    type: "button",
    className: "pisell-clear-cart-option purple-option",
    onClick: onClearItemsOnly
  }, /*#__PURE__*/React.createElement("div", {
    className: "option-icon"
  }, /*#__PURE__*/React.createElement(Trash01, {
    size: 32
  })), /*#__PURE__*/React.createElement("div", {
    className: "option-text"
  }, locales.getText('pisell2.clear-cart-modal.clear-items-only'))), /*#__PURE__*/React.createElement("button", {
    type: "button",
    className: "pisell-clear-cart-option red-option",
    onClick: onClearAllAndReset
  }, /*#__PURE__*/React.createElement("div", {
    className: "option-icon"
  }, /*#__PURE__*/React.createElement(Iconfont, {
    type: "pisell2-log-out-04",
    size: 32
  })), /*#__PURE__*/React.createElement("div", {
    className: "option-text"
  }, locales.getText('pisell2.clear-cart-modal.clear-all-reset'))))));
};
ClearCartModal.displayName = 'ClearCartModal';
export default withResponsive(ClearCartModal);