import React, { Component, PropTypes } from "react"
import { Link } from "react-router"

import cx from "classnames"

import SVGIcon from "../SVGIcon"

export default class Footer extends Component {

  static contextTypes = {
    metadata: PropTypes.object.isRequired,
  }

  render() {
    const { metadata } = this.context
    const i18n = metadata.i18n

    return (
      <div className="putainde-Footer">
        <div className="r-Grid">

          <div className="r-Grid-cell r-minM--1of4">
            <p className="putainde-Footer-text">
              {i18n.copyright.replace("{*}", new Date().getFullYear())}
            </p>
          </div>

          <div className="r-Grid-cell r-minM--2of4">
            {
              i18n.footerNavigation &&
              <ul className="putainde-Footer-list">
              {
                [
                  i18n.footerNavigation.map((item) => {
                    return (
                      <li key={item.url}>
                        <Link to={item.url}>
                          {item.name}
                        </Link>
                      </li>
                    )
                  }),
                  <li key={i18n.forum}>
                    <Link to={i18n.forum}>
                      {i18n.forumLabel}
                    </Link>
                  </li>,
                  <li key={i18n.github}>
                    <a
                      href={i18n.github}
                      data-r-tooltip={i18n.githubLabel}
                      className="r-Tooltip r-Tooltip--top"
                    >
                      <SVGIcon
                        className="putainde-Icon"
                        svg={require(`icons/github.svg`)}
                        cleanup
                      />
                    </a>
                  </li>,
                  <li key={i18n.twitter}>
                    <a
                      href={i18n.twitter}
                      data-r-tooltip={i18n.twitterLabel}
                      className="r-Tooltip r-Tooltip--top"
                    >
                      <SVGIcon
                        className="putainde-Icon"
                        svg={require(`icons/twitter.svg`)}
                        cleanup
                      />
                    </a>
                  </li>,
                  <li key={i18n.chat}>
                    <a
                      href={i18n.chat}
                      data-r-tooltip={i18n.chatLabel}
                      className="r-Tooltip r-Tooltip--top"
                    >
                      <SVGIcon
                        className="putainde-Icon"
                        svg={require(`icons/chat.svg`)}
                        cleanup
                      />
                    </a>
                  </li>,
                ]
              }
              </ul>
            }
          </div>

          <div className="r-Grid-cell r-minM--1of4 putainde-Footer-text--right">
            <span
              className={cx(
                "putainde-Footer-text",
                "putainde-Footer-text--small"
              )}
            >
              {i18n.madeWithHeart}
            </span>
          </div>

        </div>
      </div>
    )
  }
}

@@ -955,24 +955,25 @@
 li key=%7B
+ 
 item.url
 %7D%3E%0A     
@@ -956,32 +956,33 @@
 i key=%7B item.url
+ 
 %7D%3E%0A             
@@ -997,25 +997,25 @@
    %3C
-Link to
+a href
 =%7B
+ 
 item.url
 %7D%3E%0A 
@@ -1010,16 +1010,17 @@
 item.url
+ 
 %7D%3E%0A     
@@ -1041,16 +1041,17 @@
        %7B
+ 
 item.nam
@@ -1051,16 +1051,17 @@
 tem.name
+ 
 %7D%0A      
@@ -1072,36 +1072,33 @@
               %3C/
-Link
+a
 %3E%0A              

Fix feed.xml "not found"