import React from 'react';

class NavList extends React.Component {
  render() {
    const entries = Object.entries(this.props.navLinks);
    const links = entries.map(([name, link], index) => {
      return (
        <li key={index} className="nav-list__item">
          <a href={link}>{name}</a>
        </li>
      );
    });

    const className = this.props.includeBorder
      ? 'nav-list nav-list--bordered'
      : 'nav-list';

    return <ol className={className}>{links}</ol>;
  }
}

export default NavList;
