<commit_before>import React, {Component, PropTypes} from "react"
import cx from "classnames"

import Icon from "../Icon"

export default class Navigation extends Component {

  static displayName = "Navigation"

  static contextTypes = {
    file: PropTypes.object,
    i18n: PropTypes.object,
  }

  static items = [
    {
      url: "posts",
      name: "Articles",
      icon: "icons/bookmark.svg",
    },
    {
      url: "c-est-quoi-putaindecode",
      name: "Readme",
      icon: "icons/text-file.svg",
    },
    {
      url: "posts/comment-contribuer",
      name: "Participer",
      icon: "icons/pencil.svg",
    },
    {
      url: "https://github.com/putaindecode/",
      title: "GitHub",
      icon: "icons/github.svg",
    },
    {
      url: "https://twitter.com/putaindecode/",
      title: "Twitter",
      icon: "icons/twitter.svg",
    },
  ]

  render() {
    const currentPage = this.context.file._filename

    return (
      <nav className="putainde-Nav">
        {
          Navigation.items.map((item) => {
            const isActivePage = currentPage === item.url || currentPage === item.url + "/index.html"

            return (
              <a
                key={item.url}
                className={cx({
                  "putainde-Nav-item": true,
                  "putainde-Nav-item--current": isActivePage,
                  "putainde-Nav-item--icon r-Tooltip r-Tooltip--bottom": item.title,
                })}
                href={`/${item.url}`}
                data-r-tooltip={item.title ? item.title : ""}
              >
                {/* @todo handle item.icon */}
                {
                  item.icon &&
                  <Icon src={`/${item.icon}`} />
                }
                {item.name}
              </a>
            )
          })
        }
      </nav>
    )
  }
}<commit_msg>Use navigation from i18n file<commit_after>import React, {Component, PropTypes} from "react"
import cx from "classnames"

import Icon from "../Icon"

export default class Navigation extends Component {

  static displayName = "Navigation"

  static contextTypes = {
    file: PropTypes.object,
    i18n: PropTypes.object,
  }

  render() {
    const currentPage = this.context.file._filename

    return (
      <nav className="putainde-Nav">
        {
          this.context.i18n.navigation.map((item) => {
            const isActivePage = currentPage === item.url || currentPage === item.url + "/index.html"

            return (
              <a
                key={item.url}
                className={cx({
                  "putainde-Nav-item": true,
                  "putainde-Nav-item--current": isActivePage,
                  "putainde-Nav-item--icon r-Tooltip r-Tooltip--bottom": item.title,
                })}
                href={`/${item.url}`}
                data-r-tooltip={item.title ? item.title : ""}
              >
                {/* @todo handle item.icon */}
                {
                  item.icon &&
                  <Icon src={`${item.icon}`} />
                }
                {item.name}
              </a>
            )
          })
        }
      </nav>
    )
  }
}
{'fraction_non_alphanumeric': 0.1427666983222539, 'fraction_numerical': 0.0025324469768914213, 'mean_word_length': 1.4270353302611367, 'pattern_counts': {'":': 6, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '7637917', 'n_tokens_mistral': 952, 'n_tokens_neox': 917, 'n_words': 172}