????

Your IP : 3.133.83.123


Current Path : /home/ncom/www/wp-content/plugins/elementor-pro/core/app/assets/js/hooks/
Upload File :
Current File : //home/ncom/www/wp-content/plugins/elementor-pro/core/app/assets/js/hooks/use-feature-lock.js

import ConnectButtonUI from '../ui/connect-button';
import { htmlDecodeTextContent, replaceUtmPlaceholders } from '../utils';

export default function useFeatureLock( featureName ) {
	const appConfig = elementorAppProConfig[ featureName ] ?? {},
		isLocked = appConfig.lock?.is_locked ?? false;

	const buttonText = htmlDecodeTextContent( appConfig.lock?.button.text );
	const buttonLink = replaceUtmPlaceholders(
		appConfig.lock?.button.url ?? '',
		appConfig.utms ?? {},
	);

	const ConnectButton = () => (
		<ConnectButtonUI text={ buttonText } url={ buttonLink } />
	);

	return {
		isLocked,
		ConnectButton,
	};
}