"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FloatingPanelDockButton = FloatingPanelDockButton;
var _react = _interopRequireDefault(require("react"));
var _faThumbtackSlash = require("@fortawesome/free-solid-svg-icons/faThumbtackSlash");
var _faThumbtack = require("@fortawesome/free-solid-svg-icons/faThumbtack");
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 FloatingPanelDockButton({
  isDocked,
  setIsDocked
}) {
  const {
    t
  } = (0, _hooks.useTranslation)();
  const ariaLabel = isDocked ? t('Unlock from sidebar') : t('Dock to sidebar');
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
    testId: "floating-panel-dock-button",
    accentType: _button.ACCENT_TYPES.ROUND_ICON,
    onClick: () => setIsDocked(!isDocked),
    "aria-label": ariaLabel,
    tooltipText: ariaLabel,
    tooltipPlacement: _tooltip.TOOLTIP_PLACEMENT_TYPES.TOP,
    tooltipDelayType: _tooltip.TOOLTIP_DELAY_TYPES.SLOW,
    children: isDocked ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
      icon: _faThumbtackSlash.faThumbtackSlash
    }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
      icon: _faThumbtack.faThumbtack
    })
  });
}