function _extends() { _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; }; return _extends.apply(this, arguments); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

import React from 'react';
import PropTypes from 'prop-types';
import { Button, Icon } from "./..";
/**
 * @category controls
 * @component call-control
 * @variations collab-ui-react
 */

var CallControl =
/*#__PURE__*/
function (_React$PureComponent) {
  _inheritsLoose(CallControl, _React$PureComponent);

  function CallControl() {
    return _React$PureComponent.apply(this, arguments) || this;
  }

  var _proto = CallControl.prototype;

  _proto.render = function render() {
    var _this$props = this.props,
        active = _this$props.active,
        ariaLabel = _this$props.ariaLabel,
        className = _this$props.className,
        disabled = _this$props.disabled,
        onClick = _this$props.onClick,
        type = _this$props.type,
        otherHTMLProps = _objectWithoutProperties(_this$props, ["active", "ariaLabel", "className", "disabled", "onClick", "type"]);

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

  return CallControl;
}(React.PureComponent);

CallControl.displayName = 'CallControl';
CallControl.propTypes = {
  /**
   * Sets the active state for the button
   */
  active: PropTypes.bool,

  /**
   * Text to display for blindness accessibility features
   */
  ariaLabel: PropTypes.string,

  /**
   * optional css class string
   */
  className: PropTypes.string,

  /**
   * Sets the attribute disabled to the button
   */
  disabled: PropTypes.bool,

  /**
   * Handler to be called when the user taps the button
   */
  onClick: PropTypes.func,

  /**
   * Optional size prop for circular button
   */
  size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),

  /**
   * optional call control prop type
   */
  type: PropTypes.oneOf(['microphone-muted', 'cancel', 'camera-muted', 'share-screen', 'speaker'])
};
CallControl.defaultProps = {
  active: false,
  ariaLabel: '',
  className: '',
  disabled: false,
  onClick: null,
  size: 56,
  type: ''
};
export 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>
  );
}

**/