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

var Activify = function Activify() {
  return function (WrappedComponent) {
    // eslint-disable-next-line react/prop-types
    return function (_ref) {
      var active = _ref.active,
          props = _objectWithoutProperties(_ref, ["active"]);

      var _useActivify = useActivify(active),
          visible = _useActivify.visible,
          enabled = _useActivify.enabled;

      if (!enabled) return null; // eslint-disable-next-line react/jsx-props-no-spreading

      return React.createElement(WrappedComponent, _extends({}, props, {
        active: visible
      }));
    };
  };
};

export default Activify;
