import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["size", "name", "onChange", "active", "aria-label", "value", "type"];
import * as React from 'react';
import * as IconModule from '../../icons/Icon';
import { __DEV__, invariant } from '../../utils';
var Icon = IconModule.default,
    ICON_COLOR = IconModule.ICON_COLOR;

var Star = function Star(_ref) {
  var size = _ref.size,
      name = _ref.name,
      onChange = _ref.onChange,
      active = _ref.active,
      label = _ref['aria-label'],
      value = _ref.value,
      _ref$type = _ref.type,
      type = _ref$type === void 0 ? 'star' : _ref$type,
      props = _objectWithoutProperties(_ref, _excluded);

  if (__DEV__) {
    invariant(!(!active && name || !active && label || !active && value), 'name/label/value is not working in non-active Star');
  }

  return /*#__PURE__*/React.createElement("span", _extends({}, props, {
    className: "sg-rate-box__star"
  }), active && /*#__PURE__*/React.createElement("input", {
    type: "radio",
    className: "sg-rate-box__radio",
    name: name,
    onChange: onChange,
    value: value,
    "aria-label": label
  }), /*#__PURE__*/React.createElement(Icon, {
    type: type,
    size: size,
    color: ICON_COLOR.ADAPTIVE,
    className: "sg-rate-box__star-icon",
    "aria-hidden": true
  }));
};

export default Star;