Remove default icon panels

This code removes the default icon panels in our Icon component:

add_action( 'admin_print_footer_scripts', function() {
	if ( ! function_exists( 'get_current_screen' ) ) {
		return;
	}

	$screen = get_current_screen();

	if ( ! $screen->is_block_editor ) {
		return;
	}
	?>
	<script>
		wp.hooks.addFilter(
			'generateblocks.editor.iconSVGSets',
			'removeDefaultIconSets',
			function( iconSets ) {
				delete iconSets.general;
				delete iconSets.social;

				return iconSets;
			}
		);
	</script>
	<?php
}, 99 );