function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
import React from "react";
import { useIsFocused } from "@react-navigation/native";

/**
 * Compatibility wrapper for React Navigation v4's withNavigationFocus HOC
 *
 * In v4: withNavigationFocus provided an 'isFocused' prop to class components
 * In v7: useIsFocused hook is the recommended approach for functional components
 *
 * This HOC bridges the gap, allowing class components to continue using
 * the withNavigationFocus pattern while using the v7 useIsFocused hook internally.
 *
 * Usage (unchanged from v4):
 * import { withNavigationFocus } from '@plusscommunities/pluss-core-app';
 * export default withNavigationFocus(connect(mapStateToProps)(MyComponent));
 *
 * The wrapped component receives an 'isFocused' prop that is true when the
 * screen is currently focused and false when not focused.
 */
export function withNavigationFocus(Component) {
  return function WithNavigationFocusWrapper(props) {
    const isFocused = useIsFocused();
    return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
      isFocused: isFocused
    }));
  };
}
export default withNavigationFocus;
//# sourceMappingURL=withNavigationFocus.js.map