<commit_before>import _ from 'lodash'
import PropTypes from 'prop-types'
import React from 'react'
import { Menu } from 'semantic-ui-react'

import { updateForKeys } from 'docs/app/HOC'
import ComponentPropsComponent from './ComponentPropsComponent'

const ComponentPropsComponents = ({ activeName, components, onItemClick, parent }) => {
  if (components.length === 1) return

  return (
    <Menu color='green' compact size='small' secondary>
      {_.map(components, component => (
        <ComponentPropsComponent
          active={activeName === component}
          key={component}
          name={component}
          onClick={onItemClick}
          parent={parent}
        />
      ))}
    </Menu>
  )
}

ComponentPropsComponents.propTypes = {
  activeName: PropTypes.oneOfType([
    PropTypes.bool,
    PropTypes.string,
  ]),
  components: PropTypes.array,
  onItemClick: PropTypes.func,
  parent: PropTypes.string.isRequired,
}

export default updateForKeys(['activeName', 'parent'])(ComponentPropsComponents)
<commit_msg>fix(docs): fix return agrument in ComponentPropsComponents (#2581)<commit_after>import _ from 'lodash'
import PropTypes from 'prop-types'
import React from 'react'
import { Menu } from 'semantic-ui-react'

import { updateForKeys } from 'docs/app/HOC'
import ComponentPropsComponent from './ComponentPropsComponent'

const ComponentPropsComponents = ({ activeName, components, onItemClick, parent }) => {
  if (components.length === 1) return null

  return (
    <Menu color='green' compact size='small' secondary>
      {_.map(components, component => (
        <ComponentPropsComponent
          active={activeName === component}
          key={component}
          name={component}
          onClick={onItemClick}
          parent={parent}
        />
      ))}
    </Menu>
  )
}

ComponentPropsComponents.propTypes = {
  activeName: PropTypes.oneOfType([
    PropTypes.bool,
    PropTypes.string,
  ]),
  components: PropTypes.array,
  onItemClick: PropTypes.func,
  parent: PropTypes.string.isRequired,
}

export default updateForKeys(['activeName', 'parent'])(ComponentPropsComponents)

{'fraction_non_alphanumeric': 0.11958568738229755, 'fraction_numerical': 0.002824858757062147, 'mean_word_length': 3.7222222222222223, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6126430', 'n_tokens_mistral': 589, 'n_tokens_neox': 592, 'n_words': 135}