"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FloatingPanelCollapseButton = FloatingPanelCollapseButton;
var _react = _interopRequireDefault(require("react"));
var _faChevronDown = require("@fortawesome/free-solid-svg-icons/faChevronDown");
var _faChevronUp = require("@fortawesome/free-solid-svg-icons/faChevronUp");
var _button = require("../button");
var _hooks = require("../hooks");
var _fontAwesomeIcon = require("../font-awesome-icon");
var _tooltip = require("../tooltip");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function FloatingPanelCollapseButton({
  isCollapsed,
  setIsCollapsed
}) {
  const {
    t
  } = (0, _hooks.useTranslation)();
  const ariaLabel = isCollapsed ? t('Expand') : t('Collapse');
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
    testId: "floating-panel-collapse-button",
    accentType: _button.ACCENT_TYPES.ROUND_ICON,
    onClick: () => setIsCollapsed(!isCollapsed),
    "aria-label": ariaLabel,
    tooltipText: ariaLabel,
    tooltipPlacement: _tooltip.TOOLTIP_PLACEMENT_TYPES.TOP,
    tooltipDelayType: _tooltip.TOOLTIP_DELAY_TYPES.SLOW,
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
      icon: isCollapsed ? _faChevronUp.faChevronUp : _faChevronDown.faChevronDown
    })
  });
}