"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.PopupInput = void 0;

var _taggedTemplateLiteralLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));

var _react = _interopRequireDefault(require("react"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _Common = require("../../../../../Common");

var _lib = require("@sentecacommerce-theme/lib");

var _templateObject, _templateObject2, _templateObject3, _templateObject4;

var PopupInput = function PopupInput(_ref) {
  var handleClick = _ref.handleClick,
      header = _ref.header,
      label = _ref.label;

  var _useGlobalLabels = (0, _lib.useGlobalLabels)(),
      buttons = _useGlobalLabels.buttons;

  return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(Header, null, header), /*#__PURE__*/_react["default"].createElement(Inner, null, /*#__PURE__*/_react["default"].createElement(Label, null, label), /*#__PURE__*/_react["default"].createElement(_Common.Button, {
    variant: "primary",
    bordered: true,
    onClick: handleClick
  }, label ? buttons.edit : 'Add')));
};

exports.PopupInput = PopupInput;

var Container = _styledComponents["default"].div.attrs({
  className: 'pb-4 mb-2'
})(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  width: 100%;\n"])));

var Header = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteralLoose2["default"])([""])));

var Inner = _styledComponents["default"].div.attrs({
  className: 'py-2 px-4 mt-1'
})(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  background: ", ";\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n"])), function (_ref2) {
  var theme = _ref2.theme;
  return theme.palette.disabled;
});

var Label = (0, _styledComponents["default"])(_lib.OverflowEllipsis).attrs({
  lines: 1,
  lineHeight: 24
})(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  max-width: calc(100% - 9rem);\n  word-break: break-all;\n  overflow: hidden;\n"])));
//# sourceMappingURL=index.js.map