import React from 'react';
import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';
import { faBars } from '@fortawesome/free-solid-svg-icons/faBars';
import { FontAwesomeIcon } from '../font-awesome-icon';
import { useTranslation } from '../hooks/use-translation';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const MenuTrigger = ({
  isOpen,
  ariaTextClosedState = '',
  ariaTextOpenedState = '',
  triggerText,
  testId = ''
}) => {
  const {
    t
  } = useTranslation();
  const triggerTextWithDefault = typeof triggerText === 'undefined' ? t('Menu') : triggerText;
  return /*#__PURE__*/_jsxs("span", {
    className: "menu-trigger",
    children: [/*#__PURE__*/_jsx(FontAwesomeIcon, {
      icon: isOpen ? faXmark : faBars,
      "aria-label": isOpen ? ariaTextOpenedState : ariaTextClosedState,
      "aria-hidden": "false"
    }), triggerTextWithDefault ? /*#__PURE__*/_jsx("span", {
      "test-id": testId,
      children: triggerTextWithDefault
    }) : null]
  });
};
export default MenuTrigger;