var React = require('react');

class PaginationLink extends React.Component {
  render() {
    var label = this.props.label;
    var ariaLabel = this.props.ariaLabel;
    var href = this.props.href;
    var page = this.props.page;
    var className = this.props.className;

    return (
      <li className={className}>
        <a href={href} aria-label={ariaLabel} onClick={this.click.bind(this, page)}>
          {label}
        </a>
      </li>
    );
  }

  clickDisabled(e) {
    e.preventDefault();
  }

  click(page, e) {
    e.preventDefault();
    this.props.setCurrentPage(page).search();
  }
}

PaginationLink.propTypes = {
  ariaLabel: React.PropTypes.oneOfType([
    React.PropTypes.string,
    React.PropTypes.number
  ]).isRequired,
  className: React.PropTypes.string,
  href: React.PropTypes.string.isRequired,
  label: React.PropTypes.oneOfType([
    React.PropTypes.string,
    React.PropTypes.number
  ]).isRequired,
  page: React.PropTypes.number.isRequired,
  setCurrentPage: React.PropTypes.func.isRequired
};

module.exports = PaginationLink;

@@ -323,16 +323,26 @@
       %3Ca
+%0A         
  href=%7Bh
@@ -345,16 +345,26 @@
 f=%7Bhref%7D
+%0A         
  aria-la
@@ -378,16 +378,26 @@
 iaLabel%7D
+%0A         
  onClick
@@ -426,17 +426,16 @@
 , page)%7D
-%3E
 %0A       
@@ -441,15 +441,50 @@
     
-%7B
+dangerouslySetInnerHTML=%7B%7B__html: 
 label%7D
+%7D%3E
 %0A   

allow html in pagination labels