import React from 'react';
import { faChevronDown } from '@fortawesome/free-solid-svg-icons/faChevronDown';
import { faChevronUp } from '@fortawesome/free-solid-svg-icons/faChevronUp';
import { Button, ACCENT_TYPES } from '../button';
import { useTranslation } from '../hooks';
import { FontAwesomeIcon } from '../font-awesome-icon';
import { TOOLTIP_DELAY_TYPES, TOOLTIP_PLACEMENT_TYPES } from '../tooltip';
import { jsx as _jsx } from "react/jsx-runtime";
export function FloatingPanelCollapseButton({
  isCollapsed,
  setIsCollapsed
}) {
  const {
    t
  } = useTranslation();
  const ariaLabel = isCollapsed ? t('Expand') : t('Collapse');
  return /*#__PURE__*/_jsx(Button, {
    testId: "floating-panel-collapse-button",
    accentType: ACCENT_TYPES.ROUND_ICON,
    onClick: () => setIsCollapsed(!isCollapsed),
    "aria-label": ariaLabel,
    tooltipText: ariaLabel,
    tooltipPlacement: TOOLTIP_PLACEMENT_TYPES.TOP,
    tooltipDelayType: TOOLTIP_DELAY_TYPES.SLOW,
    children: /*#__PURE__*/_jsx(FontAwesomeIcon, {
      icon: isCollapsed ? faChevronUp : faChevronDown
    })
  });
}