/* ViewMore.tsx generated by @compiled/babel-plugin v0.39.1 */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ViewMore = void 0;
require("./ViewMore.compiled.css");
var _react = _interopRequireWildcard(require("react"));
var React = _react;
var _runtime = require("@compiled/react/runtime");
var _reactIntl = require("react-intl");
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
var _menu = require("@atlaskit/menu");
var _compiled = require("@atlaskit/primitives/compiled");
var _insertBlock = require("../../messages/insert-block");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var styles = {
  iconContainer: "_1e0c1txw _4cvr1h6o _1bah1h6o _1bsbzwfg _4t3i1tcg _2hwx1b66",
  buttonContent: "_zulputpp _1e0c1txw _4cvr1h6o _ca0qv77o _u5f3v77o _n3tdv77o _19bvv77o"
};
var ViewMore = exports.ViewMore = function ViewMore(_ref) {
  var onViewMore = _ref.onViewMore,
    focus = _ref.focus;
  var ref = (0, _react.useRef)(null);
  var _useIntl = (0, _reactIntl.useIntl)(),
    formatMessage = _useIntl.formatMessage;
  (0, _react.useEffect)(function () {
    if (ref.current && focus) {
      ref.current.focus();
    }
  }, [focus]);
  return /*#__PURE__*/React.createElement(_menu.Section, {
    hasSeparator: true
  }, /*#__PURE__*/React.createElement(_menu.ButtonItem, {
    onClick: onViewMore,
    "aria-label": formatMessage(_insertBlock.toolbarInsertBlockMessages.viewMoreAriaLabel),
    "data-testid": "view-more-elements-item",
    ref: ref
  }, /*#__PURE__*/React.createElement("div", {
    className: (0, _runtime.ax)([styles.buttonContent])
  }, /*#__PURE__*/React.createElement("div", {
    className: (0, _runtime.ax)([styles.iconContainer])
  }, /*#__PURE__*/React.createElement(_showMoreHorizontal.default, {
    label: "",
    spacing: "spacious"
  })), /*#__PURE__*/React.createElement(_compiled.Text, null, formatMessage(_insertBlock.toolbarInsertBlockMessages.viewMore)))));
};