/** * WordPress dependencies */ import { useSelect } from '@safe-wordpress/data'; import { _x } from '@safe-wordpress/i18n'; /** * External dependencies */ import clsx from 'clsx'; import type { OptionProps } from 'react-select'; import { store as NSR_DATA } from '@neliosr/data'; import type { Experiment } from '@neliosr/types'; import { useExperimentType } from '@neliosr/utils'; export type TestData = { readonly type: string; readonly value: number; readonly label: string; }; export const TestOption = ( { data: { type, value }, isFocused, isSelected, innerRef, innerProps, }: OptionProps< TestData > ): JSX.Element => { const post = usePost( type, value ) as Experiment | undefined; const { name, type: testType, status } = post || {}; const experimentType = useExperimentType( testType ?? '' ); const Icon = experimentType?.icon ?? ( () => <>> ); return (