/** * External dependencies */ import getRedirectUrl from '@automattic/jetpack-components/tools/jp-redirect'; import { useAnalytics } from '@automattic/jetpack-shared-extension-utils'; import { Button } from '@wordpress/components'; import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import { EVENT_PLACEMENT_FREE_USER_SCREEN, EVENT_UPGRADE } from '../constants.ts'; import useLogoGenerator from '../hooks/use-logo-generator.ts'; /** * Types */ import type { FC } from 'react'; export const UpgradeScreen: FC< { onCancel: () => void; upgradeURL: string; reason: 'feature' | 'requests'; } > = ( { onCancel, upgradeURL, reason } ) => { const { tracks } = useAnalytics(); const { recordEvent: recordTracksEvent } = tracks; const upgradeMessageFeature = __( 'Upgrade your Jetpack AI for access to logo generation. This upgrade will also increase the amount of monthly requests you can use in for all AI-powered features.', 'jetpack-ai-client' ); const upgradeMessageRequests = __( 'Not enough requests left to generate a logo. Upgrade your Jetpack AI to increase the amount of requests you can use in all AI-powered features.', 'jetpack-ai-client' ); const upgradeInfoUrl = getRedirectUrl( 'ai-logo-generator-fair-usage-policy', { anchor: 'usage-limitations-and-upgrades', } ); const { context } = useLogoGenerator(); const handleUpgradeClick = () => { recordTracksEvent( EVENT_UPGRADE, { context, placement: EVENT_PLACEMENT_FREE_USER_SCREEN } ); onCancel(); }; return (
{ reason === 'feature' ? upgradeMessageFeature : upgradeMessageRequests }  
); };