import classNames from 'classnames/dedupe';
import {Link} from 'react-router';
import React from 'react';

class PageHeaderTabs extends React.Component {
  render() {
    let {props: {tabs}} = this;

    let tabElements = tabs.map(function (tab, index) {
      let {isActive, callback} = tab;
      let classes = classNames('menu-tabbed-item', {active: isActive});
      let linkClasses = classNames('menu-tabbed-item-label', {active: isActive});

      let innerLinkSpan = <span className="menu-tabbed-item-label-text">{tab.label}</span>;
      return (
        <li className={classes} key={index}>
          <Link className={linkClasses} to={tab.routePath}>
            <span className="tab-item-label-text">
              {tab.label}
            </span>
          </Link>
        </li>
      );
    });

    return (
      <div className="page-header-navigation">
        <ul className="menu-tabbed">
          {tabElements}
        </ul>
      </div>
    );
  }
}

PageHeaderTabs.defaultProps = {
  tabs: []
};

PageHeaderTabs.propTypes = {
  tabs: React.PropTypes.arrayOf(
    React.PropTypes.shape({
      isActive: React.PropTypes.bool,
      label: React.PropTypes.node.isRequired,
      routePath: React.PropTypes.string.isRequired
    })
  )
};

module.exports = PageHeaderTabs;

@@ -543,61 +543,39 @@
     
-return (%0A        %3Cli className=%7Bclasses%7D key=%7Bindex%7D%3E
+let link = tab.callback == null
 %0A   
@@ -580,16 +580,18 @@
         
+ ?
  %3CLink c
@@ -632,16 +632,38 @@
 tePath%7D%3E
+%7BinnerLinkSpan%7D%3C/Link%3E
 %0A       
@@ -669,15 +669,12 @@
     
-  %3Cspan
+: %3Ca
  cla
@@ -684,75 +684,121 @@
 ame=
-%22tab-item-label-text%22%3E%0A              %7Btab.label%7D%0A            %3C/span
+%7BlinkClasses%7D onClick=%7Bcallback%7D%3E%7BinnerLinkSpan%7D%3C/a%3E;%0A%0A      return (%0A        %3Cli className=%7Bclasses%7D key=%7Bindex%7D
 %3E%0A  
@@ -805,23 +805,22 @@
         
-%3C/Link%3E
+%7Blink%7D
 %0A       
@@ -1266,27 +1266,54 @@
 s.string
-.isRequired
+,%0A      callback: React.PropTypes.func
 %0A    %7D)%0A

Extend tabs to allow callbacks for unrouted tab navigation