/**
* External dependencies
*/
import React from 'react';
/**
* WordPress dependencies
*/
const { __ } = wp.i18n;
/**
* Internal dependencies
*/
import Box from '../../components/sui-box';
import Select from '../../components/sui-select';
import ServerInstructions from './server-instructions';
import SettingsRow from '../../components/sui-box-settings/row';
/**
* GzipConfig component.
*
* @since 2.1.1
*/
export default class GzipConfig extends React.Component {
/**
* Component constructor.
*
* @param {Object} props
*/
constructor( props ) {
super( props );
this.state = {
currentServer: this.props.data.server_name,
};
this.handleServerChange = this.handleServerChange.bind( this );
}
/**
* Handle server select update.
*
* @param {Object} e
*/
handleServerChange( e ) {
this.setState( {
currentServer: e.target.value,
} );
}
/**
* Render component.
*
* @return {*} GzipConfig component.
*/
render() {
const fullyEnabled =
Object.entries( this.props.status ).filter( ( item ) => item[ 1 ] )
.length === 3;
if ( true === fullyEnabled ) {
return null;
}
// Remove Cloudflare from the server list.
const serverList = Object.entries(
this.props.data.servers_array
).filter( ( value ) => {
return 'cloudflare' !== value[ 0 ];
} );
const serverSelect = (
);
const serverInstructions = (
);
return (
}
/>
);
}
}