Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderSections() {
const { searchTerm } = this.state;
const { sections, useRouterLinks } = this.props;
// If there is only one section, we treat it as a root section
// In this case the name of the section won't be rendered and it won't get left padding
const firstLevel = sections.length === 1 ? sections[0].components : sections;
const filtered = filterSectionsByName(firstLevel, searchTerm);
return this.renderLevel(filtered, useRouterLinks);
}