import React, { useEffect, useLayoutEffect } from 'react';
import { usePageScrollContext } from '@wix/design-system';
export function ToolbarAndTitlebarContainer({ state, children, }) {
    const { scrollableContentRef: scrollablePageRef } = usePageScrollContext();
    useLayoutEffect(() => {
        state.toolbar.toolbarRect._syncThrottled();
    }, []);
    useEffect(() => {
        return state.init({
            scrollElement: scrollablePageRef.current,
        });
    }, []);
    return (React.createElement("div", { "data-hook": "toolbar-and-titlebar-container", ref: (el) => {
            state.toolbar.toolbarRect.element = el;
        } }, children));
}
//# sourceMappingURL=ToolbarAndTitlebarContainer.js.map