import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
var _templateObject, _templateObject2;
/** @jsx jsx */
import { useEffect, useRef } from 'react';
import { css, jsx } from '@emotion/react';
import { ButtonItem, Section } from '@atlaskit/menu';
var itemBefore = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n  width: 40px;\n  height: 40px;\n  box-sizing: border-box;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  margin-right: ", ";\n"])), "var(--ds-space-050, 4px)");
export var ViewMore = function ViewMore(_ref) {
  var item = _ref.item,
    focus = _ref.focus;
  var ref = useRef(null);
  useEffect(function () {
    if (ref.current && focus) {
      ref.current.focus();
    }
  }, [focus]);
  return jsx(Section, {
    hasSeparator: true
  }, jsx(ButtonItem, {
    onClick: item.action,
    iconBefore: 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: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n          padding: 0px ", ";\n        "])), "var(--ds-space-150, 12px)"),
    ref: ref
  }, item.title));
};