import { getPlan, PLAN_BUSINESS } from '@automattic/calypso-products'; import { localizeUrl } from '@automattic/i18n-utils'; import { SelectItem } from '@automattic/onboarding'; import { useTranslate } from 'i18n-calypso'; import paymentBlocksImage from 'calypso/assets/images/onboarding/payment-blocks.svg'; import wooCommerceImage from 'calypso/assets/images/onboarding/woo-commerce.svg'; import { shoppingBag, truck } from '../../icons'; import { StoreFeatureSet } from './types'; export function useIntents( siteSlug: string | null, hasPaymentsFeature: boolean | false, hasWooFeature: boolean | false, trackSupportLinkClick: ( url: StoreFeatureSet ) => void ): SelectItem< StoreFeatureSet >[] { const translate = useTranslate(); if ( ! siteSlug ) { return []; } return [ { key: 'simple', title: translate( 'Start simple' ), description: ( <> { hasPaymentsFeature ? translate( 'Included in your plan' ) : translate( 'Requires a {{a}}paid plan{{/a}}', { components: { a: ( ), }, } ) }
{ translate( 'Ideal if you’re looking to accept donations or sell one or two products without needing to manage shipping.' ) }
> ), icon: shoppingBag, value: 'simple', actionText: translate( 'Continue' ), }, { key: 'power', title: translate( 'More power' ), description: ( <> { hasWooFeature ? translate( 'Included in your plan' ) : // translators: %(planName)s is the name of the Creator/Business plan translate( 'Requires a {{a}}%(planName)s plan{{/a}}', { components: { a: ( ), }, args: { planName: getPlan( PLAN_BUSINESS )?.getTitle() || '', }, } ) }{ translate( 'If you have multiple products or require extensive order and shipping management then this might suit your needs better.' ) }
> ), icon: truck, value: 'power', actionText: hasWooFeature ? translate( 'Continue' ) : translate( 'Upgrade' ), }, ] as SelectItem< StoreFeatureSet >[]; }