import React, { useEffect } from 'react';
import { observer } from 'mobx-react-lite';
import { useWixPatternsContainer } from '@wix/bex-core/react';
import { usePageContext } from '../../providers';
import { WixPatternsModalsContainer } from '../WixPatternsModalsContainer';
import { WixPatternsPanelModalsContainer } from '../WixPatternsPanelModalsContainer';
import { CustomColumnsEntityPagePanelEntry } from './CustomColumnsEntityPagePanelEntry';
function _CustomColumnsEntityPagePanelMount({ state, }) {
    const { panels } = state;
    const { isPanelLayout, useRelativeSidePanel } = useWixPatternsContainer();
    const { modalsContainerRef, stackingRootRef } = usePageContext();
    useEffect(() => {
        CustomColumnsEntityPagePanelEntry.state = state;
        panels.registerSidePanel('customColumns', CustomColumnsEntityPagePanelEntry);
        return panels.init();
    }, []);
    if (isPanelLayout) {
        return React.createElement(WixPatternsPanelModalsContainer, { state: panels });
    }
    return (React.createElement(WixPatternsModalsContainer, { rootRef: stackingRootRef, anchorRef: useRelativeSidePanel ? stackingRootRef : modalsContainerRef, state: panels }));
}
_CustomColumnsEntityPagePanelMount.displayName =
    'CustomColumnsEntityPagePanelMount';
export const CustomColumnsEntityPagePanelMount = observer(_CustomColumnsEntityPagePanelMount);
//# sourceMappingURL=CustomColumnsEntityPagePanelMount.js.map