<commit_before>import React, { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import OutsideClickHandler from 'react-outside-click-handler';

import { APP_URL } from 'utils/constants';

import Icon from 'components/ui/icon';
import DropdownMenu from 'components/header/components/dropdown-menu';

import arrowIcon from 'assets/icons/arrow-down.svg?sprite';

import './styles.scss';

class NavMenu extends PureComponent {
  static propTypes = {
    className: PropTypes.string,
    fullScreen: PropTypes.bool,
    menuItems: PropTypes.array,
    NavLinkComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  };

  state = {
    activeSubmenu: '',
  };

  setActiveSubmenu = (parent) => {
    this.setState({ activeSubmenu: parent });
  };

  render() {
    const { className, menuItems, fullScreen, NavLinkComponent } = this.props;
    const { activeSubmenu } = this.state;

    return menuItems ? (
      <ul
        className={cx('c-nav-menu', className, { 'full-screen': fullScreen })}
      >
        {menuItems.map((item) => (
          <li key={item.href || item.label} className="nav-item">
            {item.href && (
              <Fragment>
                {NavLinkComponent ? (
                  <NavLinkComponent
                    href={item.href}
                    as={item.as}
                    className={cx('nav-link', { 'with-submenu': item.submenu })}
                    activeClassName="active"
                    activeShallow
                  >
                    {item.label}
                  </NavLinkComponent>
                ) : (
                  <a
                    href={`${APP_URL}${item.as || item.href}`}
                    className={cx(
                      'nav-link',
                      { 'with-submenu': item.submenu },
                      {
                        active:
                          typeof window !== 'undefined' &&
                          window.location.pathname.includes(
                            item.as || item.href
                          ),
                      }
                    )}
                  >
                    {item.label}
                  </a>
                )}
              </Fragment>
            )}
            {item.extLink && (
              <a
                href={item.extLink}
                target="_blank"
                className="nav-link"
                rel="noopener noreferrer"
              >
                {item.label}
              </a><commit_msg>remove extLink from header nav component<commit_after>import React, { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import OutsideClickHandler from 'react-outside-click-handler';

import { APP_URL } from 'utils/constants';

import Icon from 'components/ui/icon';
import DropdownMenu from 'components/header/components/dropdown-menu';

import arrowIcon from 'assets/icons/arrow-down.svg?sprite';

import './styles.scss';

class NavMenu extends PureComponent {
  static propTypes = {
    className: PropTypes.string,
    fullScreen: PropTypes.bool,
    menuItems: PropTypes.array,
    NavLinkComponent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
  };

  state = {
    activeSubmenu: '',
  };

  setActiveSubmenu = (parent) => {
    this.setState({ activeSubmenu: parent });
  };

  render() {
    const { className, menuItems, fullScreen, NavLinkComponent } = this.props;
    const { activeSubmenu } = this.state;

    return menuItems ? (
      <ul
        className={cx('c-nav-menu', className, { 'full-screen': fullScreen })}
      >
        {menuItems.map((item) => (
          <li key={item.href || item.label} className="nav-item">
            {item.href && (
              <Fragment>
                {NavLinkComponent ? (
                  <NavLinkComponent
                    href={item.href}
                    as={item.as}
                    className={cx('nav-link', { 'with-submenu': item.submenu })}
                    activeClassName="active"
                    activeShallow
                  >
                    {item.label}
                  </NavLinkComponent>
                ) : (
                  <a
                    href={`${APP_URL}${item.as || item.href}`}
                    className={cx(
                      'nav-link',
                      { 'with-submenu': item.submenu },
                      {
                        active:
                          typeof window !== 'undefined' &&
                          window.location.pathname.includes(
                            item.as || item.href
                          ),
                      }
                    )}
                  >
                    {item.label}
                  </a>
                )}
              </Fragment>
            )}
            {item.extLink && (
              <a href={item.extLink} className="nav-link">
                {item.label}
              </a>
{'fraction_non_alphanumeric': 0.11926605504587157, 'fraction_numerical': 0.0, 'mean_word_length': 1.3767772511848342, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, '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': '3828147', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1259, 'n_words': 239}