"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TestRadioButton = TestRadioButton;
exports.default = void 0;

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _styles = require("@material-ui/core/styles");

var _Button = require("../../components/elements/buttons/Button");

var _helpers = require("../../helpers");

var useStyles = function useStyles(props) {
  return (0, _styles.makeStyles)(function (theme) {
    return {
      button: {
        border: "3px solid ".concat((0, _helpers.getBorderColor)(props.selected, props.correctness, theme)),
        color: (0, _helpers.getBorderColor)(props.selected, props.correctness, theme),
        'min-width': '30px',
        'max-width': '30px',
        'min-height': '30px',
        'max-height': '30px',
        'border-radius': "100%",
        "position": "relative"
      },
      overfill: {
        "background-color": (0, _helpers.getOverfillColor)(props.selected, props.correctness, theme),
        opacity: "0.15",
        position: "absolute",
        padding: 0,
        top: 0,
        left: 0,
        width: "100%",
        height: "100%",
        'border-radius': "100%"
      }
    };
  });
};

function TestRadioButton(_ref) {
  var children = _ref.children,
      props = (0, _objectWithoutProperties2.default)(_ref, ["children"]);
  var classes = useStyles(props)();
  var theme = (0, _styles.useTheme)();
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.ButtonBase, Object.assign({
    className: classes.button
  }, props), /*#__PURE__*/_react.default.createElement("strong", null, props.label), /*#__PURE__*/_react.default.createElement("div", {
    className: classes.overfill
  })));
}

TestRadioButton.defaultProps = {
  label: '',
  selected: false,
  correctness: undefined,
  onClick: function onClick() {}
};
var _default = TestRadioButton;
exports.default = _default;