/** * External dependencies */ import React from 'react'; /** * WordPress dependencies */ const { __, sprintf } = wp.i18n; export default ({ currentStep, serverType, rulesMethod, setRulesMethod, setServerType, rulesError, smushData, makeRequest, }) => { const stepsHeading = { 1: { title: __('Choose Server Type', 'wp-smushit'), description: __( 'Choose your server type. If you don’t know this, please contact your hosting provider.', 'wp-smushit' ), }, 2: { title: __('Add Rules', 'wp-smushit'), description: 'apache' === serverType ? __( 'Smush can automatically apply WebP conversion rules for Apache servers by writing to your .htaccess file. Alternatively, switch to Manual to apply these rules yourself.', 'wp-smushit' ) : __( 'The following configurations are for NGINX servers. If you do not have access to your NGINX config files you will need to contact your hosting provider to make these changes.', 'wp-smushit' ), }, 3: { title: __('Finish Setup', 'wp-smushit'), description: __( 'The rules have been applied successfully.', 'wp-smushit' ), }, }; const getTopNotice = () => { if (1 === currentStep && smushData.isS3Enabled) { return (
{__( 'We noticed the Amazon S3 Integration is enabled. Offloaded images will not be served in WebP format, but Smush will create local WebP copies of all images. If this is undesirable, you can quit the setup.', 'wp-smushit' )}
{message}
{sprintf( /* translators: server type */ __( "We've automatically detected your server type is %s. If this is incorrect, manually select your server type to generate the relevant rules and instructions.", 'wp-smushit' ), 'nginx' === smushData.detectedServer ? 'NGINX' : 'Apache / LiteSpeed' )}
{smushData.nginxRules}
{__('Still having trouble?', 'wp_smushit')}{' '} {__('Get Support.', 'wp_smushit')}
{__( 'Please note: Some servers have both Apache and NGINX software which may not begin serving WebP images after applying the .htaccess rules. If errors occur after applying the rules, we recommend adding NGINX rules manually.', 'wp-smushit' )}
{__( 'If you are unable to get the automated method working, follow these steps:', 'wp-smushit' )}
{smushData.apacheRules}
{__( 'If .htaccess does not work, and you have access to vhosts.conf or httpd.conf, try this:', 'wp-smushit' )}
{__('Still having trouble?', 'wp_smushit')}{' '} {__('Get Support.', 'wp_smushit')}
{__('Convert Images to WebP', 'wp-smushit')}
{!smushData.isMultisite && ( )}{stepsHeading[currentStep].description}
{getStepContent()}