import classNames from 'classnames';
import './index.css';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export var FcrSwitch = function FcrSwitch(_ref) {
  var _labels$on, _labels$off;
  var labels = _ref.labels,
    value = _ref.value,
    _ref$onChange = _ref.onChange,
    onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
  var cls = classNames('fcr-switch', {
    'fcr-switch--on': value,
    'fcr-switch--off': !value
  });
  var handleClick = function handleClick() {
    onChange(!value);
  };
  return /*#__PURE__*/_jsxs("div", {
    className: cls,
    onClick: handleClick,
    children: [/*#__PURE__*/_jsxs("div", {
      className: "fcr-switch__labels",
      children: [/*#__PURE__*/_jsx("span", {
        children: (_labels$on = labels === null || labels === void 0 ? void 0 : labels.on) !== null && _labels$on !== void 0 ? _labels$on : 'ON'
      }), /*#__PURE__*/_jsx("span", {
        children: (_labels$off = labels === null || labels === void 0 ? void 0 : labels.off) !== null && _labels$off !== void 0 ? _labels$off : 'OFF'
      })]
    }), /*#__PURE__*/_jsx("div", {
      className: "fcr-switch__slider"
    })]
  });
};