From 8ab1098a1c92a57a7424d51ce619860ae21915ea Mon Sep 17 00:00:00 2001 From: Fang Date: Fri, 22 May 2020 01:40:16 +0200 Subject: [PATCH] dbug fe: render result count alongside list filter --- .../dbug/src/js/components/searchable-list.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/interface/dbug/src/js/components/searchable-list.js b/pkg/interface/dbug/src/js/components/searchable-list.js index d35abfe93..27b17e9ea 100644 --- a/pkg/interface/dbug/src/js/components/searchable-list.js +++ b/pkg/interface/dbug/src/js/components/searchable-list.js @@ -36,16 +36,14 @@ export class SearchableList extends Component { return match && item.key.includes(query); }, true); }) - if (items.length === 0) { - items = 'none'; - } else { - items = items.map(item => (
{item.jsx}
)); - } + items = items.map(item => + (
{item.jsx}
) + ); return (
{props.children} -
{searchBar}
-
{items}
+
{searchBar} ({items.length})
+
{items.length === 0 ? 'none' : items}
); } } \ No newline at end of file