import React from 'react';
import styled from 'styled-components';
import { OldIcon } from '../../../..';
import { SORT_ORDER_NONE } from '../../shared/constants';
var StyledIconChevronDown = styled(OldIcon.ChevronDown).withConfig({
  displayName: "SortIcon__StyledIconChevronDown",
  componentId: "sc-rstfua-0"
})(["margin-left:", "px;"], function (p) {
  return p.theme.spacing.unit(1);
});
var StyledIconSortArrow = styled(OldIcon.SortArrow).withConfig({
  displayName: "SortIcon__StyledIconSortArrow",
  componentId: "sc-rstfua-1"
})(["margin-left:", "px;"], function (p) {
  return p.theme.spacing.unit(1);
});
export var SortIcon = function SortIcon(_ref) {
  var sortOrder = _ref.sortOrder;
  if (sortOrder === SORT_ORDER_NONE) {
    return React.createElement(StyledIconChevronDown, {
      inline: true,
      size: 2,
      color: function color(t) {
        return t.color.label;
      }
    });
  }
  return React.createElement(StyledIconSortArrow, {
    inline: true,
    direction: sortOrder,
    size: 3,
    color: function color(t) {
      return t.color.text;
    }
  });
};