/** * WordPress dependencies */ const { __ } = wp.i18n; const { Component } = wp.element; const { Button, Modal, PanelBody, SelectControl } = wp.components; /** * Internal dependencies */ import SQLEditor from './SQLEditor.js'; class DataImport extends Component { constructor() { super( ...arguments ); this.save = this.save.bind( this ); this.state = { isOpen: false }; } save( query, name, series, data ) { this.props.databaseImportData( query, name, series, data ); this.setState({ isOpen: false }); } render() { if ( ( 'business' !== visualizerLocalize.isPro ) ) { return (

{ __( 'Upgrade your license to at least the DEVELOPER version to activate this feature!' ) }

); } return (

{ __( 'You can import data from the database here.' ) }

{ __( 'How often do you want to refresh the data from the database.' ) }

{ this.state.isOpen && ( this.setState({ isOpen: false }) } className="visualizer-db-query-modal" shouldCloseOnClickOutside={ false } > )}
); } } export default DataImport;