META-INF.resources.js.components.SegmentsExperimentsDetails.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 React from 'react';
import {SegmentsExperimentType} from '../types.es';
import {indexToPercentageString} from '../util/percentages.es';
import {STATUS_DRAFT} from '../util/statuses.es';
function SegmentsExperimentsDetails({segmentsExperiment}) {
const {
confidenceLevel,
description,
goal,
segmentsEntryName,
status,
type,
} = segmentsExperiment;
return (
<>
{Liferay.Language.get('details')}
{description && (
-
{`${Liferay.Language.get('description')}:`}
-
{description}
)}
-
{`${Liferay.Language.get('segment')}:`}
-
{segmentsEntryName}
-
{`${Liferay.Language.get('goal')}:`}
-
{goal.label}
{status.value !== STATUS_DRAFT && type.value === 'AB' && (
-
{`${Liferay.Language.get('confidence-level')}:`}
-
{indexToPercentageString(confidenceLevel)}
{Liferay.FeatureFlags['LRAC-15017'] && (
-
{`${Liferay.Language.get('test-type')}:`}
-
{Liferay.Language.get('standard')}
)}
)}
{Liferay.FeatureFlags['LRAC-15017'] &&
status.value !== STATUS_DRAFT &&
type.value === 'MAB' && (
-
{`${Liferay.Language.get('test-type')}:`}
-
{Liferay.Language.get('dynamic')}
)}
>
);
}
SegmentsExperimentsDetails.propTypes = {
segmentsExperiment: SegmentsExperimentType,
};
export default SegmentsExperimentsDetails;