/** * External dependencies */ import { __, sprintf } from '@wordpress/i18n'; import { Button, Tooltip } from '@wordpress/components'; import { getNewPath } from '@woocommerce/navigation'; import { help } from '@wordpress/icons'; import { useContext } from '@wordpress/element'; /** * Internal dependencies */ import { getAdminSetting } from '../../../utils/admin-settings'; import { Subscription } from './types'; import './my-subscriptions.scss'; import { InstalledSubscriptionsTable, AvailableSubscriptionsTable, } from './table/table'; import { installedSubscriptionRow, availableSubscriptionRow, } from './table/table-rows'; import { SubscriptionsContext } from '../../contexts/subscriptions-context'; export default function MySubscriptions(): JSX.Element { const { subscriptions, isLoading } = useContext( SubscriptionsContext ); const updateConnectionUrl = getNewPath( { page: 'wc-addons', section: 'helper', filter: 'all', 'wc-helper-refresh': 1, 'wc-helper-nonce': getAdminSetting( 'wc_helper_nonces' ).refresh, 'redirect-to-wc-admin': 1, }, '' ); const updateConnectionHTML = sprintf( // translators: %s is a link to the update connection page. __( 'If you don\'t see your subscription, try updating your connection.', 'woocommerce' ), updateConnectionUrl ); const subscriptionsInstalled: Array< Subscription > = subscriptions.filter( ( subscription: Subscription ) => subscription.local.installed ); const subscriptionsAvailable: Array< Subscription > = subscriptions.filter( ( subscription: Subscription ) => ! subscriptionsInstalled.includes( subscription ) ); return (
your account on WooCommerce.com.',
'woocommerce'
),
} }
/>
>
}
>
{ __(
"Still don't see your subscription?",
'woocommerce'
) }
{ __( 'Your unused WooCommerce.com subscriptions.', 'woocommerce' ) }
{ __( 'Easily install your existing free to install WooCommerce.com subscriptions across sites.', 'woocommerce' ) }