import React from 'react';
import { routeProp } from '../../../utils/propTypes';
import NavItem from './NavItem';

var Navigation = function Navigation(_ref) {
  var isMobileOpen = _ref.isMobileOpen,
      toggleMobileOpen = _ref.toggleMobileOpen,
      routes = _ref.routes;
  var closedClass = isMobileOpen ? '' : 'mobile-closed';

  if (!routes.length) {
    return null;
  }

  return React.createElement("nav", {
    id: "navigation",
    className: "main-navigation singlelevel auto-highlight ".concat(closedClass)
  }, React.createElement("ul", {
    id: "nav_list",
    className: "top-level-nav"
  }, routes.map(function (route) {
    return React.createElement(NavItem, Object.assign({}, route, {
      toggleMobileOpen: toggleMobileOpen
    }));
  })));
};

export default Navigation;