'use strict';

exports.__esModule = true;

var _extends2 = require('babel-runtime/helpers/extends');

var _extends3 = _interopRequireDefault(_extends2);

var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');

var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _2 = require('./..');

var _lodash = require('lodash');

var _lodash2 = _interopRequireDefault(_lodash);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * @category containers
 * @component list-item
 * @variations collab-ui-react
 */

var ListItemHeader = function (_React$PureComponent) {
  (0, _inherits3.default)(ListItemHeader, _React$PureComponent);

  function ListItemHeader() {
    var _temp, _this, _ret;

    (0, _classCallCheck3.default)(this, ListItemHeader);

    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args))), _this), _this.state = {
      id: _lodash2.default.uniqueId(_this.props.id && _this.props.id + '-' || 'cui-space-list-item__header-')
    }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
  }

  ListItemHeader.prototype.render = function render() {
    var _props = this.props,
        className = _props.className,
        children = _props.children,
        header = _props.header,
        props = (0, _objectWithoutProperties3.default)(_props, ['className', 'children', 'header']);
    var id = this.state.id;


    var staticChildren = [_react2.default.createElement(
      _2.ListItemSection,
      { key: 'child-0', position: 'center' },
      _react2.default.createElement(
        'div',
        { className: 'cui-list-item__header' },
        header
      )
    ), _react2.default.createElement(
      _2.ListItemSection,
      { key: 'child-1', position: 'right' },
      children
    )];

    return _react2.default.createElement(
      _2.ListItem,
      (0, _extends3.default)({
        className: 'cui-list-item-header' + ('' + (className && ' ' + className || '')),
        id: id,
        tabIndex: -1,
        onClick: function onClick() {
          return false;
        },
        onKeyDown: function onKeyDown() {
          return false;
        },
        focusable: false
      }, props),
      staticChildren
    );
  };

  return ListItemHeader;
}(_react2.default.PureComponent);

ListItemHeader.displayName = 'ListItemHeader';
exports.default = ListItemHeader;


/**
* @name List Item Header
*
* @category containers
* @component list-item
* @section header
*
* @js
*
import { List, ListItemHeader } from '@collab-ui/react';
import { NavLink } from 'react-router-dom';

export default class SpaceListExamples extends React.PureComponent {

  render() {
    const anchorNode = <NavLink to='/containers/list-item'>More</NavLink>;
    return(
      <div className="medium-4 columns">
        <List>
          <ListItemHeader header='Testing' children={anchorNode} />
        </List>
        <List className='cui--dark' style={{backgroundColor: 'rgba(40,40,40,0.72)'}}>
          <ListItemHeader header='Testing' children={anchorNode}/>
        </List>
      </div>
    );
  }
}
**/
ListItemHeader.defaultProps = {
  className: '',
  children: null,
  id: '',
  isReadOnly: true
};

module.exports = exports['default'];