"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _faXmark = require("@fortawesome/free-solid-svg-icons/faXmark");
var _faBars = require("@fortawesome/free-solid-svg-icons/faBars");
var _fontAwesomeIcon = require("../font-awesome-icon");
var _useTranslation = require("../hooks/use-translation");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const MenuTrigger = ({
  isOpen,
  ariaTextClosedState = '',
  ariaTextOpenedState = '',
  triggerText,
  testId = ''
}) => {
  const {
    t
  } = (0, _useTranslation.useTranslation)();
  const triggerTextWithDefault = typeof triggerText === 'undefined' ? t('Menu') : triggerText;
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
    className: "menu-trigger",
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
      icon: isOpen ? _faXmark.faXmark : _faBars.faBars,
      "aria-label": isOpen ? ariaTextOpenedState : ariaTextClosedState,
      "aria-hidden": "false"
    }), triggerTextWithDefault ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      "test-id": testId,
      children: triggerTextWithDefault
    }) : null]
  });
};
var _default = exports.default = MenuTrigger;