/**
 * WordPress dependencies
 */
import { render } from '@safe-wordpress/element';

/**
 * External dependencies
 */
import { PremiumFeature } from '@nab/components';

export function initializePremiumLinks(): void {
	Array.from(
		document.querySelectorAll( '.nab-premium-feature-wrapper' )
	).forEach( ( node ) =>
		render(
			<PremiumFeature
				className="nab-premium-setting-button"
				size="small"
				feature={ node.getAttribute( 'data-setting' ) || '' }
				requiredPlan={ node.getAttribute( 'data-required-plan' ) || '' }
			/>,
			node
		)
	);
}
