META-INF.resources.js.components.ConnectToAC.es.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.segments.experiment.web
Show all versions of com.liferay.segments.experiment.web
Liferay Segments Experiment Web
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
import ClayIcon from '@clayui/icon';
import ClayLink from '@clayui/link';
import PropTypes from 'prop-types';
import React from 'react';
export default function ConnectToAC({
analyticsURL,
isAnalyticsConnected,
hideAnalyticsReportsPanelURL,
pathToAssets,
onHideAnalyticsReportsPanelClick = (event) => {
event.preventDefault();
if (document.hrefFm && typeof submitForm !== 'undefined') {
submitForm(document.hrefFm, hideAnalyticsReportsPanelURL);
}
},
}) {
return (
{isAnalyticsConnected ? (
<>
{Liferay.Language.get('sync-to-analytics-cloud')}
{Liferay.Language.get(
'in-order-to-perform-an-ab-test,-your-site-has-to-be-synced-to-liferay-analytics-cloud'
)}
{Liferay.Language.get('open-analytics-cloud')}
>
) : (
<>
{Liferay.Language.get(
'connect-to-liferay-analytics-cloud'
)}
{Liferay.Language.get(
'in-order-to-perform-an-ab-test,-your-liferay-dxp-instance-has-to-be-connected'
)}
{Liferay.Language.get('do-not-show-me-this-again')}
{Liferay.Language.get('do-not-show-me-this-again-help')}
>
)}
);
}
ConnectToAC.propTypes = {
analyticsURL: PropTypes.string,
hideAnalyticsReportsPanelURL: PropTypes.string.isRequired,
isAnalyticsConnected: PropTypes.bool.isRequired,
pathToAssets: PropTypes.string.isRequired,
};