/**
 * 
 * @file CollapsibleSidebar item component that will render stylized collapsedElement or expanded depending on the expanded prop.
 * @author Box
 *
 * CollapsibleSidebar item component that will render stylized collapsedElement or expanded depending on the expanded prop.
 */
import * as React from 'react';
import Tooltip from '../../components/tooltip';
import LeftSidebarLinkCallout from '../left-sidebar/LeftSidebarLinkCallout';

function CollapsibleSidebarItem(props) {
  var callout = props.callout,
      collapsedElement = props.collapsedElement,
      expanded = props.expanded,
      expandedElement = props.expandedElement,
      tooltipMessage = props.tooltipMessage;

  if (callout) {
    var calloutChildren = expanded ? expandedElement : collapsedElement;
    return /*#__PURE__*/React.createElement(LeftSidebarLinkCallout, {
      attachmentPosition: "bottom left",
      callout: callout,
      targetAttachmentPosition: "bottom right"
    }, calloutChildren);
  }

  var wrappedCollapsedElement = /*#__PURE__*/React.createElement(Tooltip, {
    isTabbable: false,
    position: "middle-right",
    text: tooltipMessage,
    isDisabled: !tooltipMessage
  }, collapsedElement);
  return expanded ? expandedElement : wrappedCollapsedElement;
}

export default CollapsibleSidebarItem;
//# sourceMappingURL=CollapsibleSidebarItem.js.map