import { WixPatternsContainerOverridesProvider, WixPatternsInitialPropsProvider, useWixPatternsContainer, } from '@wix/bex-core/react';
import { CairoProvider } from '../../providers';
import React, { useState } from 'react';
export function PickerContentProvider(props) {
    const { children, modalState: { fetchInitialProps }, } = props;
    const container = useWixPatternsContainer();
    const [initialProps] = useState(() => ({
        messages: fetchInitialProps.status.value.data?.cairoMessages,
    }));
    // avoid showing toasts under modal context
    // https://wix.slack.com/archives/C4MVDTET1/p1633861135370100
    const [wixPatternsContainerOverrides] = useState(() => ({
        showToast: () => ({ remove: () => { } }),
        events: container.events,
        onNavigationModal: container.onNavigationModal,
    }));
    return (React.createElement(WixPatternsInitialPropsProvider, { value: initialProps },
        React.createElement(WixPatternsContainerOverridesProvider, { value: wixPatternsContainerOverrides },
            React.createElement(CairoProvider, { value: container }, children))));
}
//# sourceMappingURL=PickerContentProvider.js.map