"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ViewMore = void 0;
var _react = require("react");
var _react2 = require("@emotion/react");
var _menu = require("@atlaskit/menu");
/** @jsx jsx */

var itemBefore = (0, _react2.css)({
  width: '40px',
  height: '40px',
  boxSizing: 'border-box',
  display: 'flex',
  justifyContent: 'center',
  alignItems: 'center',
  marginRight: "var(--ds-space-050, 4px)"
});
var ViewMore = exports.ViewMore = function ViewMore(_ref) {
  var item = _ref.item,
    focus = _ref.focus;
  var ref = (0, _react.useRef)(null);
  (0, _react.useEffect)(function () {
    if (ref.current && focus) {
      ref.current.focus();
    }
  }, [focus]);
  return (0, _react2.jsx)(_menu.Section, {
    hasSeparator: true
  }, (0, _react2.jsx)(_menu.ButtonItem, {
    onClick: item.action,
    iconBefore: (0, _react2.jsx)("div", {
      css: itemBefore
    }, item.icon()),
    "aria-describedby": item.title,
    "data-testid": "view-more-elements-item"
    // @ts-ignore Overriding Menu styles is not supported
    ,
    css: (0, _react2.css)({
      padding: "0px ".concat("var(--ds-space-150, 12px)")
    }),
    ref: ref
  }, item.title));
};