search_section.jsx 580 B

1234567891011121314151617181920
  1. import PropTypes from 'prop-types';
  2. import { FormattedMessage } from 'react-intl';
  3. export const SearchSection = ({ title, onClickMore, children }) => (
  4. <div className='search-results__section'>
  5. <div className='search-results__section__header'>
  6. <h3>{title}</h3>
  7. {onClickMore && <button onClick={onClickMore}><FormattedMessage id='search_results.see_all' defaultMessage='See all' /></button>}
  8. </div>
  9. {children}
  10. </div>
  11. );
  12. SearchSection.propTypes = {
  13. title: PropTypes.node.isRequired,
  14. onClickMore: PropTypes.func,
  15. children: PropTypes.children,
  16. };