"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = ToggleSelectButton;
var _react = _interopRequireDefault(require("react"));
var _faCheck = require("@fortawesome/free-solid-svg-icons/faCheck");
var _fontAwesomeIcon = require("../font-awesome-icon");
var _button = require("../button");
var _useTranslation = require("../hooks/use-translation");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function ToggleSelectButton({
  isSelected,
  onToggle,
  selectContentText: selectContentTextParams,
  isDisabled = false,
  deselectContent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
    icon: _faCheck.faCheck
  })
}) {
  const {
    t
  } = (0, _useTranslation.useTranslation)();
  const selectContentText = selectContentTextParams ?? t('Select');
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
    className: "select-toggle-button",
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
      accentType: _button.ACCENT_TYPES.COMMAND,
      testId: "select-toggle-button",
      isDisabled: isDisabled,
      onClick: onToggle,
      children: isSelected ? deselectContent : selectContentText
    })
  });
}