/** * WordPress dependencies */ import { Button, ExternalLink } from '@safe-wordpress/components'; import { useSelect } from '@safe-wordpress/data'; import { useState } from '@safe-wordpress/element'; import { _x } from '@safe-wordpress/i18n'; /** * External dependencies */ import { store as NC_DATA } from '@nelio-content/data'; import { PREMIUM_FEATURES, getSubscribeLabel, getSubscribeLink, } from '@nelio-content/utils'; /** * Internal dependencies */ import './style.scss'; import { LicensePopover } from './license-popover'; import NelioContentLogo from '../../../assets/src/images/full-logo.svg'; export type SubscriptionRequiredPageProps = { readonly page: 'account' | 'content-board'; }; export const SubscriptionRequiredPage = ( { page, }: SubscriptionRequiredPageProps ): JSX.Element => { const { title, subtitle } = TITLES[ page ]; const [ isVisible, setVisible ] = useState( false ); const [ isLocked, lock ] = useState( false ); const today = useSelect( ( select ) => select( NC_DATA ).getToday(), [] ); const subscribeLink = getSubscribeLink( today, 'calendar-sidebar' ); const subscribeLabel = getSubscribeLabel( today ); return (

{ title }

{ subtitle }

{ subscribeLabel }

{ _x( 'Do you already have a valid subscription?', 'text', 'nelio-content' ) }{ ' ' } setVisible( false ) } isOpen={ isVisible } isLocked={ isLocked } lock={ lock } />

{ _x( 'Nelio Content Premium also gives you:', 'text', 'nelio-content' ) }

); }; // ======= // HELPERS // ======= const TITLES: Record< SubscriptionRequiredPageProps[ 'page' ], { title: string; subtitle: string } > = { account: { title: _x( 'Maximize the potential of your blog with Nelio Content Premium', 'user', 'nelio-content' ), subtitle: _x( 'Streamline your content creation, scheduling, and promotion on all relevant social platforms, including X, Bluesky, Instagram, or Threads.', 'user', 'nelio-content' ), }, 'content-board': { title: _x( 'Manage all your content with Nelio Content Premium', 'user', 'nelio-content' ), subtitle: _x( 'Get Nelio Content’s Board today—a Kanban-like view that makes it easy to monitor and manage WordPress content.', 'user', 'nelio-content' ), }, };