/** * WordPress dependencies */ import { useSelect } from '@safe-wordpress/data'; /** * External dependencies */ import { Maybe } from '@neliosr/types'; const NAB_EXPERIMENTS = 'nab/experiments'; type ExperimentType = { // eslint-disable-next-line @typescript-eslint/no-explicit-any readonly icon: ( props?: Record< string, any > ) => JSX.Element; readonly title: string; readonly description: string; }; export const useExperimentType = ( type: string ): Maybe< ExperimentType > => useSelect( ( select ) => // @ts-expect-error This method exists in the store // eslint-disable-next-line @typescript-eslint/no-unsafe-call select( NAB_EXPERIMENTS )?.getExperimentType( type ) as Maybe< ExperimentType > );