import { useBlockProps, BlockIcon, ButtonBlockAppender, InnerBlocks, store as blockEditorStore, RichText, } from '@wordpress/block-editor'; import { Placeholder } from '@wordpress/components'; import { group as groupIcon } from '@wordpress/icons'; import { __ } from '@wordpress/i18n'; import { useSelect } from '@wordpress/data'; export default function Edit( props ) { const { clientId } = props; const hasInnerBlocks = useSelect( ( select ) => select( blockEditorStore ).getBlockCount( clientId ) > 0, [ clientId ] ); return (
{ ! hasInnerBlocks ? ( ) : ( ) }
); } function PlaceholderContent( { clientId } ) { return ( <> } label={ __( 'Widget Group' ) } > ); } function PreviewContent( { attributes, setAttributes } ) { return ( <> setAttributes( { title } ) } /> ); }