import { jsx } from "@emotion/core";
import PropTypes from "prop-types";
import MaterialCheckbox from "@material-ui/core/Checkbox";
import FormControlLabel from "@material-ui/core/FormControlLabel";
import { ThemeProvider } from "@material-ui/styles";
import { MaterialTheme } from "@hackoregon/ui-themes";

var Checkbox = function Checkbox(_ref) {
  var variant = _ref.variant,
      onChange = _ref.onChange,
      disabled = _ref.disabled,
      value = _ref.value,
      label = _ref.label,
      labelPlacement = _ref.labelPlacement;
  return jsx(ThemeProvider, {
    theme: MaterialTheme
  }, jsx(FormControlLabel, {
    value: label,
    control: jsx(MaterialCheckbox, {
      checked: value,
      variant: variant,
      onChange: onChange,
      disabled: disabled,
      inputProps: {
        "aria-label": {
          label: label
        }
      }
    }),
    label: label,
    labelPlacement: labelPlacement
  }));
};

Checkbox.displayName = "Checkbox";
Checkbox.propTypes = {
  value: PropTypes.bool,
  label: PropTypes.string,
  labelPlacement: PropTypes.string,
  variant: PropTypes.string,
  disabled: PropTypes.bool,
  onChange: PropTypes.func
};
Checkbox.defaultProps = {
  value: false,
  label: "Label",
  labelPlacement: "end",
  variant: "contained",
  disabled: false
};
export default Checkbox;