import React from 'react';
import { locales } from '@pisell/utils';
import { PREFIX } from "../constants";
import { stopPropagation } from "../utils/render";
var NoteRow = function NoteRow(_ref) {
  var note = _ref.note,
    disabledEdit = _ref.disabledEdit,
    _onClick = _ref.onClick;
  if (!note && disabledEdit) return null;
  return /*#__PURE__*/React.createElement("div", {
    className: "".concat(PREFIX, "__note")
  }, note ? /*#__PURE__*/React.createElement("div", {
    className: "".concat(PREFIX, "__note-text")
  }, locales.getText('pisell2.sale-cart.line-item.note'), ": ", note) : null, !disabledEdit ? /*#__PURE__*/React.createElement("button", {
    className: "".concat(PREFIX, "__note-btn"),
    type: "button",
    onClick: function onClick(event) {
      stopPropagation(event);
      _onClick === null || _onClick === void 0 || _onClick();
    }
  }, locales.getText(note ? 'pisell2.sale-cart.line-item.edit-note' : 'pisell2.sale-cart.line-item.add-note')) : null);
};
export default NoteRow;