/**
* WordPress dependencies
*/
import { Button, ExternalLink } from '@safe-wordpress/components';
import { createHigherOrderComponent } from '@safe-wordpress/compose';
import { useSelect, useDispatch } from '@safe-wordpress/data';
import { _x, __ } from '@safe-wordpress/i18n';
import type { PremiumFeature } from '@nelio-content/types';
/**
* Internal dependencies
*/
import { store as NC_DATA } from './store';
import { useAdminUrl, useCanManagePlugin } from './hooks';
export const withProfileCheck = createHigherOrderComponent(
( Component: ( _: unknown ) => JSX.Element ) => ( props ) => {
const hasProfiles = useSelect(
( select ) => 0 < select( NC_DATA ).getSocialProfileCount(),
[]
);
const canManagePlugin = useCanManagePlugin();
const settingsUrl = useAdminUrl( 'admin.php', {
page: 'nelio-content-settings',
subpage: 'social--profiles',
} );
if ( hasProfiles ) {
return
{ _x( 'Nelio Content helps you to engage with your audience by sharing your WordPress content on social media. Please ask the site manager to connect one or more social profiles to Nelio Content.', 'user', 'nelio-content' ) }
); } return ({ _x( 'Nelio Content helps you to engage with your audience by sharing your WordPress content on social media. Connect one or more social profiles and then refresh this page to use them.', 'user', 'nelio-content' ) }