import { NavLink } from 'react-router-dom'; import classNames from 'classnames'; import Icon from '../icon'; class SectionHeadlineBarItem extends PureComponent { static propTypes = { to: PropTypes.string, icon: PropTypes.string, className: PropTypes.string, onClick: PropTypes.func, title: PropTypes.oneOfType([ PropTypes.string, PropTypes.node, ]), exact: PropTypes.bool, }; render() { const { to, title, icon, className, onClick, exact } = this.props; const classes = classNames('section-header-bar__item', className); if (to) { return ( {title} ) } else if (icon) { return ( ) } return ( ) } }; export default class SectionHeadlineBar extends PureComponent { static propTypes = { items: PropTypes.array.isRequired, className: PropTypes.string, }; render() { const { items, className } = this.props; const classes = classNames('section-headline-bar', className); return (
{ items.forEach((item, i) => ( )) }
) } }