import { Dialog } from '@elementor/app-ui'; import { Context as TemplatesContext } from '../context/templates'; export default function DialogDelete( props ) { const { deleteTemplate, findTemplateItemInState } = React.useContext( TemplatesContext ); const closeDialog = ( shouldUpdate ) => { props.setId( null ); if ( shouldUpdate ) { deleteTemplate( props.id ); } }; if ( ! props.id ) { return ''; } const template = findTemplateItemInState( props.id ); return ( closeDialog( true ) } approveButtonText={ __( 'Move to Trash', 'elementor-pro' ) } approveButtonOnClick={ () => closeDialog( true ) } approveButtonColor="danger" dismissButtonText={ __( 'Cancel', 'elementor-pro' ) } dismissButtonOnClick={ () => closeDialog() } onClose={ () => closeDialog() } /> ); } DialogDelete.propTypes = { id: PropTypes.number, setId: PropTypes.func.isRequired, }; module.exports = { plugins: { tailwindcss: {}, autoprefixer: { grid: true }, }, }; No direct access allowed.