import { Box, CounterBadge, Heading, Text, TextButton, } from '@wix/design-system';
import React from 'react';
import { ImportStepUpload } from './ImportStepUpload';
import { ImportStepConfiguration } from './ImportStepConfiguration';
import { ImportStepProgress } from './ImportStepProgress';
export function getImportModalStepProps({ state, isMobile, }) {
    const { currentStep, translate: t } = state;
    if (currentStep === 'upload') {
        return {
            title: t('cairo.import.title'),
            subtitle: t('cairo.import.subtitle'),
            children: React.createElement(ImportStepUpload, { state: state }),
            footnote: (React.createElement(Box, { gap: "SP1", verticalAlign: "middle" },
                React.createElement(Text, { size: "small", secondary: true }, t('cairo.import.footerText')),
                React.createElement(TextButton, { size: "small" }, t('cairo.import.footerLink')))),
            showFooterDivider: false,
            secondaryButtonText: t('cairo.import.cancel'),
            secondaryButtonOnClick: state.close,
            closeButtonProps: { onClick: state.close, autoFocus: true },
            onRequestClose: state.close,
        };
    }
    if (currentStep === 'configuration') {
        const handleClose = () => state.discardAndClose();
        return {
            removeContentPadding: true,
            title: isMobile ? (React.createElement(Box, { gap: "SP1", verticalAlign: "middle", direction: "horizontal" },
                t('cairo.import.configureMappingsTitle'),
                React.createElement(CounterBadge, { size: "medium", skin: "neutralLight", dataHook: "import-columns-found-counter" }, state.csvHeaders.length))) : (React.createElement(Box, { gap: "SP1", verticalAlign: "middle", direction: "horizontal" },
                React.createElement(Heading, { size: "medium" }, t('cairo.import.configureMappingsTitle')),
                React.createElement(CounterBadge, { size: "medium", skin: "neutralLight", dataHook: "import-columns-found-counter" }, state.csvHeaders.length))),
            subtitle: t('cairo.import.subtitle'),
            children: React.createElement(ImportStepConfiguration, { state: state }),
            showFooterDivider: true,
            primaryButtonText: t('cairo.import.startImport'),
            primaryButtonOnClick: state.hasMappings ? state.startImport : undefined,
            ...(isMobile
                ? { primaryButtonProps: { disabled: !state.hasMappings } }
                : {
                    primaryButtonTooltipProps: !state.hasMappings
                        ? { content: t('cairo.import.noMappingsTooltip') }
                        : undefined,
                }),
            secondaryButtonText: t('cairo.import.cancel'),
            secondaryButtonOnClick: handleClose,
            closeButtonProps: {
                onClick: handleClose,
                autoFocus: true,
            },
            onRequestClose: handleClose,
        };
    }
    return {
        title: t('cairo.import.progressTitle'),
        children: React.createElement(ImportStepProgress, { state: state }),
        showFooterDivider: false,
        primaryButtonText: t('cairo.import.importing'),
        primaryButtonProps: { disabled: true },
        secondaryButtonText: state.isRestoring
            ? t('cairo.import.restoring')
            : t('cairo.import.cancel'),
        secondaryButtonOnClick: state.close,
        secondaryButtonProps: { disabled: state.isRestoring },
        closeButtonProps: { onClick: state.close },
        onRequestClose: state.isRestoring ? undefined : state.close,
    };
}
//# sourceMappingURL=getImportModalStepProps.js.map