import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["className", "isSorted", "isSortedDesc", "sortType"];
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
import Icon from '../Icon';
import { CaretDown16, CaretUp16 } from '@wfp/icons-react';
export default function TableSorting(_ref) {
  var className = _ref.className,
      isSorted = _ref.isSorted,
      isSortedDesc = _ref.isSortedDesc,
      sortType = _ref.sortType,
      other = _objectWithoutProperties(_ref, _excluded);

  var classes = classNames(className, 'wfp--table--sorting', {
    'wfp--table--is-sorted': isSorted,
    'wfp--table--is-sortable': sortType
  });
  return /*#__PURE__*/React.createElement("span", {
    className: classes
  }, isSorted ? isSortedDesc ? /*#__PURE__*/React.createElement(CaretDown16, null) : /*#__PURE__*/React.createElement(CaretUp16, null) : '');
}
TableSorting.propTypes = {
  /**
   * Provide the content for the Table, usually `<thead />` or `<tbody/>`
   */
  children: PropTypes.node,

  /**
   * Provide a custom className to be applied to the containing <table /> node
   */
  className: PropTypes.string,

  /**
   * Displays a border around the  <table /> node
   */
  withBorder: PropTypes.bool
};