import { Text } from '@wix/design-system';
import React from 'react';
import { useWixPatternsContainer } from '@wix/bex-core/react';
import { CustomActionModal } from '../ActionModal';
import { observer } from 'mobx-react-lite';
export const _ArchiveFieldModal = ({ state, }) => {
    const container = useWixPatternsContainer();
    const { translate: t } = container;
    const { dataExtension, modal } = state;
    const getModalTitle = () => {
        const fieldId = modal.value?.id;
        if (dataExtension.enableArchive && fieldId) {
            const fieldValues = dataExtension.extractFieldValuesFromSchema(fieldId);
            if (fieldValues?.name) {
                return t('cairo.customFields.archive.modal.title.enabled', {
                    selectedField: fieldValues.name,
                });
            }
        }
        return t('cairo.customFields.archive.modal.title');
    };
    const getModalDescription = () => {
        if (dataExtension.enableArchive) {
            return t('cairo.customFields.archive.modal.description.enabled');
        }
        return t('cairo.customFields.archive.modal.description');
    };
    return (React.createElement(CustomActionModal, { dataHook: "archive-custom-field-modal", state: state.modal, title: getModalTitle(), primaryButtonText: t('cairo.customFields.archive.modal.CTA'), secondaryButtonText: t('cairo.customFields.archive.modal.cancel.CTA'), content: React.createElement(Text, { dataHook: "archive-custom-field-body" }, getModalDescription()), theme: "destructive", width: "510px" }));
};
export const ArchiveFieldModal = observer(_ArchiveFieldModal);
//# sourceMappingURL=ArchiveFieldModal.js.map