HEX
Server: Apache/2.4.29 (Ubuntu)
System: Linux bareserver 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User: root (0)
PHP: 7.2.24-0ubuntu0.18.04.17
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/cursos/wp-content/plugins/ninja-forms/src/components/triggerBulkExportComponent.js
import { Component } from '@wordpress/element';
import PropTypes from 'prop-types';
import { __ } from '@wordpress/i18n';
import { Button } from '@wordpress/components';
import { DisplayBulkExport } from './';

export class TriggerBulkExportComponent extends Component {
	constructor( props ) {
		super( props );
		this.state = { compOpen: false };
		this.setOpen = this.setOpen.bind( this );
		this.setClose = this.setClose.bind( this );
	}

	setOpen() {
		this.setState( { compOpen: true } );
	}
	setClose() {
		this.setState( { compOpen: false } );
	}

	render() {
		const { state, props, setClose } = this;
		const { compOpen } = state;

		const data = {
			fetchController: new AbortController(),
			props,
			setClose,
		};

		return (
			<>
				<Button
					style={ { height: '30px', borderRadius: '3px' } }
					isSecondary
					onClick={ this.setOpen }
				>
					{ __( 'Bulk Form Exports', 'ninja-forms' ) }
				</Button>
				{ compOpen && <DisplayBulkExport data={ data } /> }
			</>
		);
	}
}

TriggerBulkExportComponent.propTypes = {
	globalParams: PropTypes.object.isRequired,
	bulkExportParams: PropTypes.object.isRequired
}