/** * WordPress dependencies */ import { useSelect } from '@safe-wordpress/data'; /** * External dependencies */ import { SubscribeAction } from '@nelio-content/components'; import { store as NC_DATA, useIsSubscribed } from '@nelio-content/data'; import { hasSubscriptionPromo } from '@nelio-content/utils'; export const PromoPanel = (): JSX.Element | null => { const isSubscribed = useIsSubscribed(); const today = useSelect( ( select ) => select( NC_DATA ).getToday(), [] ); if ( isSubscribed || ! hasSubscriptionPromo( today ) ) { return null; } return (
); };