/** * External dependencies */ import { useSelect } from '@wordpress/data'; import { Spinner } from '@woocommerce/components'; import { ONBOARDING_STORE_NAME, SETTINGS_STORE_NAME } from '@woocommerce/data'; /** * Internal dependencies */ import { BundleBusinessDetailsStep } from './flows/bundle'; import { SelectiveFeaturesBusinessStep } from './flows/selective-bundle'; import './style.scss'; import { isSelectiveBundleInstallSegmentation } from './data/segmentation'; export const BusinessDetailsStep = ( props ) => { const { profileItems, settings, isLoading } = useSelect( ( select ) => { return { isLoading: ! select( ONBOARDING_STORE_NAME ).hasFinishedResolution( 'getProfileItems' ) || ! select( SETTINGS_STORE_NAME ).hasFinishedResolution( 'getSettings', [ 'general' ] ), profileItems: select( ONBOARDING_STORE_NAME ).getProfileItems(), settings: select( SETTINGS_STORE_NAME ).getSettings( 'general' ) || {}, }; } ); const country = settings.general ? settings.general.woocommerce_default_country : null; const industrySlugs = ( profileItems.industry || [] ).map( ( industry ) => industry.slug ); const selectiveBundleInstallSegmentation = isSelectiveBundleInstallSegmentation( country, industrySlugs ); if ( isLoading ) { return (