"use strict";

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

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

var _reactFeather = require("react-feather");

var _styleContext = require("../styleContext");

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

var BooleanInput = function BooleanInput(_ref) {
  var onChange = _ref.onChange,
      value = _ref.value;
  var classes = (0, _styleContext.useCustomStyle)();
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: classes.cursor_pointer
  }, !!value && /*#__PURE__*/_react["default"].createElement(_reactFeather.ToggleRight, {
    className: classes.input__boolean__on,
    onClick: function onClick() {
      return onChange(false);
    }
  }), !value && /*#__PURE__*/_react["default"].createElement(_reactFeather.ToggleLeft, {
    className: classes.input__boolean__off,
    onClick: function onClick() {
      return onChange(true);
    }
  }));
};

exports.BooleanInput = BooleanInput;