import React, { PropTypes } from 'react';
import cx from 'classnames';
import Tab from './Tab';

function renderChildren(props) {
  return React.Children.map(props.children, (child) => {
    // if child is not a tab we don't need to clone it
    // since we don't need to add custom props

    if (child.type !== Tab) {
      return child;
    }

    const clonedProps = {
      activeTabClassName: props.activeTabClassName,
      disabledTabClassName: props.disabledTabClassName,
    };

    return React.cloneElement(child, clonedProps);
  });
}

module.exports = React.createClass({
  displayName: 'TabList',

  propTypes: {
    className: PropTypes.string,
    activeTabClassName: PropTypes.string,
    disabledTabClassName: PropTypes.string,
    children: PropTypes.oneOfType([
      PropTypes.object,
      PropTypes.array,
    ]),
  },

  render() {
    const {
      className,
      activeTabClassName,
      disabledTabClassName,
      children,
      ...attributes } = this.props;

    return (
      <ul
        {...attributes}
        className={cx(
          'ReactTabs__TabList',
          className
        )}
        role="tablist"
      >
        {renderChildren({ activeTabClassName, disabledTabClassName, children })}
      </ul>
    );
  },
});

@@ -18,16 +18,27 @@
 ropTypes
+, Component
  %7D from 
@@ -557,73 +557,51 @@
 %0A%7D%0A%0A
-module.exports = React.createClass(%7B%0A  displayName: 'TabList',%0A%0A 
+class TabList extends Component %7B%0A%0A  static
  pro
@@ -606,17 +606,18 @@
 ropTypes
-:
+ =
  %7B%0A    c
@@ -824,17 +824,17 @@
  %5D),%0A  %7D
-,
+;
 %0A%0A  rend
@@ -1247,10 +1247,32 @@
 %0A  %7D
-,
 %0A%7D
-)
+%0A%0Aexport default TabList
 ;%0A

add tab list