import {
Button,
Dialog,
DialogActions,
DialogContent,
Stack,
Typography,
} from '@elementor/ui';
import { AlertTriangleFilledIcon, XIcon } from '@elementor/icons';
import { __ } from '@wordpress/i18n';
import * as PropTypes from 'prop-types';
const getDialogContent = ( type ) => {
switch ( type ) {
case 'both':
return {
title: __( 'Override all classes and variables?', 'elementor' ),
description: __( 'This will delete all existing classes and variables and replace them with the imported ones. This action cannot be undone.', 'elementor' ),
};
case 'variables':
return {
title: __( 'Override all variables?', 'elementor' ),
description: __( 'This will delete all existing variables and replace them with the imported ones. This action cannot be undone.', 'elementor' ),
};
case 'classes':
default:
return {
title: __( 'Override all classes?', 'elementor' ),
description: __( 'This will delete all existing classes and replace them with the imported ones. This action cannot be undone.', 'elementor' ),
};
}
};
export function OverrideConfirmationDialog( {
open,
onClose,
onConfirm,
type = 'classes',
} ) {
const { title, description } = getDialogContent( type );
return (
);
}
OverrideConfirmationDialog.propTypes = {
open: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
onConfirm: PropTypes.func.isRequired,
type: PropTypes.oneOf( [ 'classes', 'variables', 'both' ] ),
};