import React from 'react';
import TabPane from './TabPane.js';
class Tabs extends React.Component {
render() {
const {type, children = [], activeTab, onTabClick, className} = this.props;
return (
{children.map(child => React.cloneElement(child,
{
key: child.props.tabId,
onClick: () => onTabClick(child.props.tabId),
activeTab
}))}
{children.map(child => {
if (child.props.tabId === activeTab) {
return child.props.children;
}
})}
);
}
}
export default Tabs;