+ { !! templartPartsAsBlockPatterns.length && (
+
+
{ __( 'Existing template parts' ) }
+ {
+ onTemplatePartSelect( pattern.templatePart );
+ } }
+ />
+
+ ) }
+
+ { !! blockPatterns.length && (
+
+
{ __( 'Patterns' ) }
+ {
+ if ( isReplacingTemplatePartContent ) {
+ replaceInnerBlocks( clientId, blocks );
+ } else {
+ createFromBlocks( blocks, pattern.title );
+ }
+
+ onClose();
+ } }
+ />
+
+ ) }
+
+ >
+ );
+}
diff --git a/packages/block-library/src/template-part/edit/selection/index.js b/packages/block-library/src/template-part/edit/selection/index.js
deleted file mode 100644
index e96ae8f7200a4..0000000000000
--- a/packages/block-library/src/template-part/edit/selection/index.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * WordPress dependencies
- */
-import { SearchControl } from '@wordpress/components';
-import { useState } from '@wordpress/element';
-
-/**
- * Internal dependencies
- */
-import TemplatePartPreviews from './template-part-previews';
-
-export default function TemplatePartSelection( {
- setAttributes,
- onClose,
- area,
- templatePartId = null,
-} ) {
- const [ filterValue, setFilterValue ] = useState( '' );
- return (
-