var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

import React from 'react';
import { Add } from 'grommet-icons/es6/icons/Add';
import { Subtract } from 'grommet-icons/es6/icons/Subtract';

import { StyledExpander } from '../StyledPagingTable';

export default (function (_ref) {
  var isExpanded = _ref.isExpanded,
      children = _ref.children,
      expanderProps = _ref.expanderProps;

  var props = _extends({
    CloseIcon: React.createElement(Subtract, null),
    OpenIcon: React.createElement(Add, null),
    tabIndex: '0',
    onClick: function onClick() {}
  }, expanderProps);

  var OpenIcon = props.OpenIcon,
      CloseIcon = props.CloseIcon,
      rest = _objectWithoutProperties(props, ['OpenIcon', 'CloseIcon']);

  return React.createElement(
    StyledExpander,
    _extends({
      a11yTitle: 'Press Enter to expand this row for more information',
      icon: isExpanded ? CloseIcon : OpenIcon
    }, rest),
    children
  );
});