Liferay.Loader.define("layout-content-page-editor-web@2.0.157/page_editor/plugins/comments/components/CommentForm", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/button', 'frontend-js-react-web$prop-types', 'frontend-js-react-web$react', '../../../common/components/Button', '../../../common/components/Editor', '../../../common/components/InvisibleFieldset'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = CommentForm;

    var _button = _interopRequireDefault(require("@frontend-taglib-clay$clayui/button"));

    var _propTypes = _interopRequireDefault(require("frontend-js-react-web$prop-types"));

    var _react = _interopRequireDefault(require("frontend-js-react-web$react"));

    var _Button = _interopRequireDefault(require("../../../common/components/Button"));

    var _Editor = _interopRequireDefault(require("../../../common/components/Editor"));

    var _InvisibleFieldset = _interopRequireDefault(require("../../../common/components/InvisibleFieldset"));

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * This library is free software; you can redistribute it and/or modify it under
     * the terms of the GNU Lesser General Public License as published by the Free
     * Software Foundation; either version 2.1 of the License, or (at your option)
     * any later version.
     *
     * This library is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
     * details.
     */
    function CommentForm(_ref) {
      var _ref$autoFocus = _ref.autoFocus,
          autoFocus = _ref$autoFocus === void 0 ? false : _ref$autoFocus,
          id = _ref.id,
          _ref$loading = _ref.loading,
          loading = _ref$loading === void 0 ? false : _ref$loading,
          onCancelButtonClick = _ref.onCancelButtonClick,
          _ref$onFormFocus = _ref.onFormFocus,
          onFormFocus = _ref$onFormFocus === void 0 ? function () {} : _ref$onFormFocus,
          onSubmitButtonClick = _ref.onSubmitButtonClick,
          onTextareaChange = _ref.onTextareaChange,
          _ref$showButtons = _ref.showButtons,
          showButtons = _ref$showButtons === void 0 ? false : _ref$showButtons,
          submitButtonLabel = _ref.submitButtonLabel,
          textareaContent = _ref.textareaContent;
      return (/*#__PURE__*/_react.default.createElement("form", {
          onFocus: onFormFocus
        }, /*#__PURE__*/_react.default.createElement(_InvisibleFieldset.default, {
          disabled: loading
        }, /*#__PURE__*/_react.default.createElement("div", {
          className: "form-group form-group-sm"
        }, /*#__PURE__*/_react.default.createElement("label", {
          className: "sr-only",
          htmlFor: id
        }, Liferay.Language.get('add-comment')), /*#__PURE__*/_react.default.createElement(_Editor.default, {
          autoFocus: autoFocus,
          configurationName: "comment",
          id: id,
          initialValue: textareaContent,
          onChange: onTextareaChange,
          placeholder: Liferay.Language.get('type-your-comment-here')
        })), showButtons && /*#__PURE__*/_react.default.createElement(_button.default.Group, {
          className: "mb-3",
          spaced: true
        }, /*#__PURE__*/_react.default.createElement(_Button.default, {
          disabled: !textareaContent,
          displayType: "primary",
          loading: loading,
          onClick: onSubmitButtonClick,
          small: true
        }, submitButtonLabel), /*#__PURE__*/_react.default.createElement(_Button.default, {
          displayType: "secondary",
          onClick: onCancelButtonClick,
          small: true,
          type: "button"
        }, Liferay.Language.get('cancel')))))
      );
    }
    //# sourceMappingURL=CommentForm.js.map
  }
});
//# sourceMappingURL=CommentForm.js.map