import React from 'react';
import classNames from 'classnames';
import { locales } from '@pisell/utils';
import Divider from "../Divider";
import "./index.less";
var prefix = 'pisell-lowcode-';
var Note = function Note(props) {
  var item = props.item,
    type = props.type,
    openNote = props.openNote,
    disabledEdit = props.disabledEdit;
  return item !== null && item !== void 0 && item.note || !disabledEdit ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
    type: type
  }), /*#__PURE__*/React.createElement("div", {
    className: classNames("".concat(prefix, "product-note-wrap"))
  }, item !== null && item !== void 0 && item.note ? /*#__PURE__*/React.createElement("div", null, locales.getText('pisell2.product.card.discount.note'), ": ", item.note) : null, !disabledEdit ? /*#__PURE__*/React.createElement("span", {
    className: "".concat(prefix, "product-note-btn"),
    onClick: function onClick(e) {
      e.preventDefault();
      e.stopPropagation();
      openNote();
    }
  }, item !== null && item !== void 0 && item.note ? locales.getText('pisell2.product.card.discount.edit.note') : locales.getText('pisell2.product.card.discount.add.note')) : null)) : null;
};
export default Note;