import _extends from '@babel/runtime/helpers/extends';
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import { IconButton } from '@carbon/react';
import * as React from 'react';
import PropTypes from 'prop-types';

var _excluded = ["direction", "align", "tooltipText"];
var TooltipIcon = function TooltipIcon(props) {
  var direction = props.direction,
    align = props.align,
    tooltipText = props.tooltipText,
    other = _objectWithoutProperties(props, _excluded);
  var newAlign;
  // This function is to pass the old direction, align property to the new align property since The align and direction props have been merged into the align prop
  if (direction === 'bottom' && align === 'center') {
    newAlign = 'bottom';
  } else if (direction === 'bottom' && align === 'end') {
    newAlign = 'bottom-end';
  } else if (direction === 'top' && align === 'start') {
    newAlign = 'top-start';
  } else if (direction === 'top' && align === 'center') {
    newAlign = 'top';
  } else if (direction === 'top' && align === 'end') {
    newAlign = 'top-end';
  } else if (direction === 'right' && align === 'start') {
    newAlign = 'right-start';
  } else if (direction === 'right' && align === 'center') {
    newAlign = 'right';
  } else if (direction === 'right' && align === 'end') {
    newAlign = 'right-end';
  } else if (direction === 'left' && align === 'start') {
    newAlign = 'left-start';
  } else if (direction === 'left' && align === 'center') {
    newAlign = 'left';
  } else if (direction === 'left' && align === 'end') {
    newAlign = 'left-end';
  } else {
    newAlign = 'bottom-start';
  }
  return /*#__PURE__*/React.createElement(IconButton, _extends({}, other, {
    // The tooltipText prop has been renamed to label
    label: tooltipText,
    align: newAlign
  }));
};
TooltipIcon.propTypes = {
  direction: PropTypes.string,
  align: PropTypes.string,
  tooltipText: PropTypes.string
};
TooltipIcon.defaultProps = {
  direction: 'bottom',
  align: 'start',
  tooltipText: ''
};
TooltipIcon.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "TooltipIcon",
  "props": {
    "direction": {
      "defaultValue": {
        "value": "'bottom'",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "align": {
      "defaultValue": {
        "value": "'start'",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "tooltipText": {
      "defaultValue": {
        "value": "''",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    }
  }
};
var TooltipIcon$1 = TooltipIcon;

export { TooltipIcon$1 as default };
