/**
 * ActivateAnalyticsCTA component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */
import PropTypes from 'prop-types';

/**
 * WordPress dependencies
 */
import { createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import useActivateModuleCallback from '../hooks/useActivateModuleCallback';
import Button from './Button';

export default function ActivateAnalyticsCTA( { children } ) {
	const activateModuleCallback = useActivateModuleCallback( 'analytics' );

	if ( ! activateModuleCallback ) {
		return null;
	}

	return (
		<div className="googlesitekit-analytics-cta">
			<div className="googlesitekit-analytics-cta__preview-graphs">
				{ children }
			</div>
			<div className="googlesitekit-analytics-cta__details">
				<p className="googlesitekit-analytics-cta--description">
					{ createInterpolateElement(
						__(
							'See how many people visit your site from Search and track how you’re achieving your goals: <strong>install Google Analytics.</strong>',
							'google-site-kit'
						),
						{
							strong: <strong />,
						}
					) }
				</p>
				<Button onClick={ activateModuleCallback }>
					{ __( 'Set up Google Analytics', 'google-site-kit' ) }
				</Button>
			</div>
		</div>
	);
}

ActivateAnalyticsCTA.propTypes = {
	children: PropTypes.node.isRequired,
};

@@ -756,71 +756,8 @@
  */%0A
-import %7B createInterpolateElement %7D from '@wordpress/element';%0A
 impo
@@ -1404,45 +1404,12 @@
 %09%09%7B 
-createInterpolateElement(%0A%09%09%09%09%09%09
 __(%0A
-%09
 %09%09%09%09
@@ -1504,56 +1504,12 @@
 oals
-: %3Cstrong%3Einstall Google Analytics.%3C/strong%3E
+.
 ',%0A
-%09
 %09%09%09%09
@@ -1532,60 +1532,8 @@
 it'%0A
-%09%09%09%09%09%09),%0A%09%09%09%09%09%09%7B%0A%09%09%09%09%09%09%09strong: %3Cstrong /%3E,%0A%09%09%09%09%09%09%7D%0A
 %09%09%09%09

Update wording of ActivateAnalyticsCTA.