/** * External dependencies */ import { registerBlockType } from '@wordpress/blocks'; import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings'; import { useBlockProps } from '@wordpress/block-editor'; import { Placeholder } from '@wordpress/components'; import { __, sprintf } from '@wordpress/i18n'; import { box, Icon } from '@wordpress/icons'; /** * Internal dependencies */ import './editor.scss'; import './style.scss'; import { TEMPLATES } from './constants'; interface Props { attributes: { template: string; align: string; }; } const Edit = ( { attributes }: Props ) => { const blockProps = useBlockProps(); const templateTitle = TEMPLATES[ attributes.template ]?.title ?? attributes.template; const templatePlaceholder = TEMPLATES[ attributes.template ]?.placeholder ?? 'fallback'; return (
{ __( 'Attention: Do not remove this block!', 'woo-gutenberg-products-block' ) } { ' ' } { __( 'Removal will cause unintended effects on your store.', 'woo-gutenberg-products-block' ) }
{ sprintf( /* translators: %s is the template title */ __( 'This is an editor placeholder for the %s. On your store this will be replaced by the template and display with your product image(s), title, price, etc. You can move this placeholder around and add further blocks around it to extend the template.', 'woo-gutenberg-products-block' ), templateTitle ) }