'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 _ = require('./..');

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

/**
 * @category controls
 * @component call-control
 * @variations collab-ui-react
 */

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

  function CallControl() {
    (0, _classCallCheck3.default)(this, CallControl);
    return (0, _possibleConstructorReturn3.default)(this, _React$PureComponent.apply(this, arguments));
  }

  CallControl.prototype.render = function render() {
    var _props = this.props,
        active = _props.active,
        type = _props.type,
        onClick = _props.onClick,
        disabled = _props.disabled,
        className = _props.className,
        ariaLabel = _props.ariaLabel,
        otherHTMLProps = (0, _objectWithoutProperties3.default)(_props, ['active', 'type', 'onClick', 'disabled', 'className', 'ariaLabel']);


    return _react2.default.createElement(
      _.Button,
      (0, _extends3.default)({
        className: 'cui-call-control' + ('' + (type === 'cancel' && ' cui-call-control--cancel' || '')) + ('' + (active && ' cui-call-control--active' || '')) + ('' + (className && ' ' + className || '')),
        circle: true,
        disabled: disabled,
        onClick: onClick,
        ariaLabel: ariaLabel || type
      }, otherHTMLProps),
      _react2.default.createElement(_.Icon, { name: type + '_24' })
    );
  };

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

CallControl.displayName = 'CallControl';


CallControl.defaultProps = {
  type: '',
  onClick: null,
  className: '',
  disabled: false,
  active: false,
  ariaLabel: ''
};

exports.default = CallControl;

/**
* @name Default Call-Control
* @description Default Call-Control.
*
* @category controls
* @component call-control
* @section default
*
* @js

export default function CallControlDefault() {
  return(
    <div className='row' style={{marginBottom: '1rem'}}>
      <div>Default</div>
      <div className='columns small-3'>
        <CallControl
          type='microphone-muted'
          ariaLabel='For the Win'
        />
      </div>
    </div>
  );
}

**/

/**
* @name Call-Control with active
* @description Call control with active class.
*
* @category controls
* @component call-control
* @section active
*
* @js

export default function CallControlActive() {
  return(
    <div className='row' style={{marginBottom: '1rem'}}>
      <div>Default</div>
      <div className='columns small-3'>
        <CallControl
          type='microphone-muted'
          active
          onClick={() => {}}
          ariaLabel='For the Win'
        />
      </div>
    </div>
  );
}

**/

/**
* @name Call-Control with disable
* @description Call-Control with disabled class.
*
* @category controls
* @component call-control
* @section disable
*
* @js

export default function CallControlDisabled() {
  return(
    <div className='row' style={{marginBottom: '1rem'}}>
      <div>Default</div>
      <div className='columns small-3'>
        <CallControl
          type='microphone-muted'
          disabled
          onClick={() => {}}
          ariaLabel='For the Win'
        />
      </div>
    </div>
  );
}

**/

/**
* @name Call-Control cancel
* @description Call-Control with cancel class.
*
* @category controls
* @component call-control
* @section cancel
*
* @js

export default function CallControlCancel() {
  return(
    <div className='row' style={{marginBottom: '1rem'}}>
      <div>Default</div>
      <div className='columns small-3'>
        <CallControl
          type='cancel'
          onClick={() => {}}
          ariaLabel='For the Win'
        />
      </div>
    </div>
  );
}

**/

module.exports = exports['default'];