/** * WordPress dependencies */ import { Button } from '@safe-wordpress/components'; import { useSelect } from '@safe-wordpress/data'; import { _x, sprintf } from '@safe-wordpress/i18n'; /** * External dependencies */ import { store as NAB_EXPERIMENTS } from '@nab/experiments'; import type { PendingExperimentSummary } from '@nab/types'; /** * Internal dependencies */ import './style.scss'; type PendingExperimentProps = { readonly experiment: PendingExperimentSummary; }; export function PendingExperiment( { experiment, }: PendingExperimentProps ): JSX.Element | null { const experimentType = useSelect( ( select ) => select( NAB_EXPERIMENTS ).getExperimentType( experiment.type ), [ experiment.type ] ); if ( ! experimentType ) { return null; } const Icon = experimentType.icon; return (
  • { experiment.name.trim() ? experiment.name.trim() : _x( '(no name)', 'text', 'nelio-ab-testing' ) }
  • ); }