import { createRoot } from 'react-dom/client';
import Personalization from './Personalization';

/**
 * Render site analytics
 */
document.addEventListener(
	'DOMContentLoaded',
	() => {
		const el = document.getElementById( 'growthstack-personalization' );
		if ( el ) {
			const args = JSON.parse( el.dataset.args || '{}' );
			const root = createRoot( el );
			root.render(
				<Personalization assetsFolder={ args.assetsFolder } />
			);
		}
	},
	false
);
