import React from 'react';
import { d as _objectWithoutProperties, e as _extends } from '../_rollupPluginBabelHelpers-b9ad31fa.js';
import useActivify from '../hooks/useActivify.js';

var _excluded = ["active"];
var Activify = function Activify() {
  return function (WrappedComponent) {
    // eslint-disable-next-line react/prop-types
    return function (_ref) {
      var active = _ref.active,
        props = _objectWithoutProperties(_ref, _excluded);
      var _useActivify = useActivify(active),
        visible = _useActivify.visible,
        enabled = _useActivify.enabled;
      if (!enabled) return null;
      // eslint-disable-next-line react/jsx-props-no-spreading
      return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
        active: visible
      }));
    };
  };
};

export default Activify;
