diff --git a/src/pages/instant-observability.js b/src/pages/instant-observability.js index 00577857f..56366560d 100644 --- a/src/pages/instant-observability.js +++ b/src/pages/instant-observability.js @@ -23,8 +23,8 @@ import BUILD_YOUR_OWN from '../images/build-your-own.svg'; import { useDebounce } from 'react-use'; import { sortFeaturedQuickstarts } from '../utils/sortFeaturedQuickstarts'; -const { QUICKSTARTS_REPO } = require('../data/constants'); -const CATEGORIES = require('../data/instant-observability-categories'); +import { QUICKSTARTS_REPO } from '../data/constants'; +import CATEGORIES from '../data/instant-observability-categories'; const FILTERS = [ { name: 'All', type: '', icon: 'nr-all-entities' }, @@ -148,6 +148,13 @@ const QuickstartsPage = ({ data, location }) => { .filter(filterByContentType(filter)) .filter(filterByCategory(category)); + const categoriesWithCount = CATEGORIES.map((cat) => ({ + ...cat, + count: quickstarts + .filter(filterBySearch(search)) + .filter(filterByCategory(cat.value)).length, + })); + const filtersWithCount = FILTERS.map((filter) => ({ ...filter, count: quickstarts @@ -208,6 +215,7 @@ const QuickstartsPage = ({ data, location }) => {