META-INF.resources.js.components.ConnectToAC.tsx Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.analytics.reports.web
Show all versions of com.liferay.analytics.reports.web
Liferay Analytics Reports 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 React, {MouseEventHandler} from 'react';
interface Props {
analyticsURL: string;
hideAnalyticsReportsPanelURL: string;
isAnalyticsConnected: boolean;
onHideAnalyticsReportsPanelClick: MouseEventHandler;
pathToAssets: string;
}
export default function ConnectToAC({
analyticsURL,
isAnalyticsConnected,
hideAnalyticsReportsPanelURL,
pathToAssets,
onHideAnalyticsReportsPanelClick = (event) => {
event.preventDefault();
// @ts-ignore
if (document.hrefFm && typeof submitForm !== 'undefined') {
// @ts-ignore
submitForm(document.hrefFm, hideAnalyticsReportsPanelURL);
}
},
}: Props) {
return (
{isAnalyticsConnected ? (
<>
{Liferay.Language.get('sync-to-analytics-cloud')}
{Liferay.Language.get(
'sync-your-liferay-dxp-instance-with-analytics-cloud-to-view-content-performance-metrics-and-build-a-successful-content-strategy'
)}
{Liferay.Language.get('open-analytics-cloud')}
>
) : (
<>
{Liferay.Language.get(
'connect-to-liferay-analytics-cloud'
)}
{Liferay.Language.get(
'liferay-dxp-instance-has-to-be-connected-with-analytics-cloud-to-view-content-performance-metrics-and-build-a-successful-content-strategy'
)}
{Liferay.Language.get('do-not-show-me-this-again')}
{Liferay.Language.get('do-not-show-me-this-again-help')}
>
)}
);
}