"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireWildcard(require("react"));
var _constants = require("../../../constants");
var _commons = require("../../../commons");
var _helpers = require("../helpers");
const menuConfig = _constants.MENUS_CONFIG_MAP[_constants.CLEAR_FORMAT];
const ClearFormatMenu = _ref => {
  let {
    isRichEditor,
    className,
    editor,
    readonly
  } = _ref;
  const onMouseDown = (0, _react.useCallback)(() => {
    (0, _helpers.clearStyles)(editor);
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);
  const props = {
    isRichEditor,
    className,
    ...menuConfig,
    disabled: (0, _helpers.isMenuDisabled)(editor, readonly),
    isActive: false,
    'onMouseDown': onMouseDown
  };
  return /*#__PURE__*/_react.default.createElement(_commons.MenuItem, props);
};
var _default = exports.default = ClearFormatMenu;