import React, { useCallback, useContext } from 'react';
import { FocusableContext } from './FocusableWrapper';
export function withFocusable(WrappedComponent) {
    return (props) => {
        const context = useContext(FocusableContext);
        const registerScrollableItem = useCallback((args) => {
            context?.focusable?.registerScrollableItem?.(args);
        }, [context]);
        const addedProps = {
            registerScrollableItem,
        };
        return React.createElement(WrappedComponent, { ...props, ...addedProps });
    };
}
//# sourceMappingURL=withFocusable.js.map