/** * WordPress dependencies */ import { _x } from '@safe-wordpress/i18n'; import { store as CORE } from '@safe-wordpress/core-data'; /** * External dependencies */ import { PremiumActionTypeDefinition } from '@nelio/forms/types'; const action: PremiumActionTypeDefinition = { isPremium: true as const, isUnique: false, type: 'post-creation', label: _x( 'Content creation', 'text', 'nelio-forms' ), icon: 'admin-post', canCurrentUserUse: ( select ) => !! select( CORE ) .getPostTypes( { per_page: -1 } ) ?.filter( ( p ) => select( CORE ).canUser( 'create', p.rest_base, '' ) ).length, }; export default action;