/**
 * Fundraiser Stats Block - Editor Registration
 */
( function( blocks, element, i18n, serverSideRender ) {
	var el = element.createElement;
	var __ = i18n.__;

	blocks.registerBlockType( 'ambassadorhub/fundraiser-stats', {
		title: __( 'Fundraiser Stats', 'ambassadorhub' ),
		icon: 'chart-bar',
		category: 'ambassadorhub',
		edit: function( props ) {
			var blockProps = wp.blockEditor.useBlockProps();
			return el( 'div', blockProps,
				el( serverSideRender, {
					block: 'ambassadorhub/fundraiser-stats',
					attributes: props.attributes
				} )
			);
		},
		save: function() {
			return null; // Server-side render
		}
	} );
} )(
	window.wp.blocks,
	window.wp.element,
	window.wp.i18n,
	window.wp.serverSideRender
);
