File "edit.tsx"

Full Path: /home/warrior1/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/blocks/featured-items/edit.tsx
File size: 583 bytes
MIME-type: text/x-java
Charset: utf-8

/**
 * External dependencies
 */
import { FunctionComponent } from 'react';
import { useBlockProps } from '@wordpress/block-editor';

export function Edit< T >( Block: FunctionComponent< T > ) {
	return function WithBlock( props: T ): JSX.Element {
		const blockProps = useBlockProps();

		// The useBlockProps function returns the style with the `color`.
		// We need to remove it to avoid the block to be styled with the color.
		const { color, ...styles } = blockProps.style;

		return (
			<div { ...blockProps } style={ styles }>
				<Block { ...props } />
			</div>
		);
	};
}