import { Drawer, Modal } from '@wix/design-system';
import React, { useState } from 'react';
import { useToolbarCollectionContext } from '../ToolbarCollectionContext';
import { ModalState } from '@wix/bex-core';
import { ExportButtonModalLayout } from './ExportButtonModalLayout';
import { observer } from 'mobx-react-lite';
import { useIsMobile } from '../../hooks/useIsMobile';
function _ExportModal(props) {
    const table = useToolbarCollectionContext();
    const [exportModalState] = useState(() => (table.exportState ??= new ModalState()));
    const isMobile = useIsMobile();
    const child = (React.createElement(ExportButtonModalLayout, { ...props, exportModalState: exportModalState }));
    if (isMobile) {
        return (React.createElement(Drawer, { dataHook: "export-modal", open: exportModalState.isOpen, onClose: exportModalState.close }, child));
    }
    return (React.createElement(Modal, { onRequestClose: exportModalState.close, isOpen: exportModalState.isOpen, dataHook: "export-modal" }, child));
}
export const ExportModal = observer(_ExportModal);
//# sourceMappingURL=ExportModal.js.map