import React from 'react';
import Icon from "@/jsx/Components/Icon.jsx";

export default class NavButton extends React.Component {

  constructor(props) {
    super(props);
  }

  handleClick(ev) {
    this.props.onClick(ev);
  }

  render() {
    const {icon, className} = this.props;
    return (
      <button
        className={`ra-nav-button ${className ? className : ''}`}
        onClick={this.handleClick.bind(this)}
      >
        {
          icon && <Icon>{icon}</Icon>
        }
        <span className="ra-nav-button-text">
          {this.props.children}
        </span>
      </button>
    );
  }

}
