import React from 'react';
import classNames from 'classnames';
import { Iconfont } from '@pisell/materials';
import { useContext } from "./useContext";
import { locales } from '@pisell/utils';
var useAddService = function useAddService(id, type) {
  var _useContext = useContext(),
    state = _useContext.state,
    onAddProduct = _useContext.onAddProduct;
  var isProductList = state.isProductList,
    disabledEdit = state.disabledEdit;
  return !disabledEdit ? /*#__PURE__*/React.createElement("div", {
    className: classNames('pisell-lowcode__shopping-cart-add-service', {
      'pisell-lowcode__shopping-cart-add-service-products': isProductList
    }),
    onClick: function onClick() {
      return onAddProduct(id);
    }
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      display: 'flex',
      alignItems: 'center',
      gap: 6
    }
  }, /*#__PURE__*/React.createElement(Iconfont, {
    type: "pisell2-plus-circle"
  }), /*#__PURE__*/React.createElement("span", null, type === 'more' ? locales.getText('pisell2.text.shopping-cart.add.more') : locales.getText('pisell2.text.shopping-cart.add.service')))) : null;
};
export default useAddService;