woocommerce/plugins/woocommerce-admin/client/customize-store/assembler-hub/hooks/block-placeholder/use-is-no-blocks-placeholde...

17 lines
390 B
TypeScript

/**
* External dependencies
*/
import { BlockInstance } from '@wordpress/blocks';
/**
* Internal dependencies
*/
import { noBlocksPlaceholderClientId } from './use-add-no-blocks-placeholder';
export const useIsNoBlocksPlaceholderPresent = ( blocks: BlockInstance[] ) => {
return (
blocks.find(
( block ) => block.clientId === noBlocksPlaceholderClientId
) !== undefined
);
};