mirror of
https://github.com/proelements/proelements.git
synced 2026-04-05 20:13:47 +00:00
23 lines
621 B
JavaScript
23 lines
621 B
JavaScript
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,
|
|
};
|
|
}
|