diff --git a/editor/components/inserter/menu.js b/editor/components/inserter/menu.js index 2d91af86dc5e14..b86487293aea3f 100644 --- a/editor/components/inserter/menu.js +++ b/editor/components/inserter/menu.js @@ -11,6 +11,7 @@ import { pick, some, sortBy, + isEmpty, } from 'lodash'; import { connect } from 'react-redux'; @@ -255,6 +256,14 @@ export class InserterMenu extends Component { } renderCategories( visibleBlocksByCategory ) { + if ( isEmpty( visibleBlocksByCategory ) ) { + return ( + + { __( 'No blocks found' ) } + + ); + } + return getCategories().map( ( category ) => this.renderCategory( category, visibleBlocksByCategory[ category.slug ] ) ); diff --git a/editor/components/inserter/style.scss b/editor/components/inserter/style.scss index deb835e931290e..280a9df45f4504 100644 --- a/editor/components/inserter/style.scss +++ b/editor/components/inserter/style.scss @@ -115,6 +115,13 @@ input[type="search"].editor-inserter__search { overflow: auto; } +.editor-inserter__no-results { + display: block; + text-align: center; + font-style: italic; + padding: 8px; +} + .editor-inserter__tabs { display: flex; flex-direction: column;