Files
optolith-client/js/components/SubTabs.js
T
Lukas Obermann e1927227bf Changed data objects to ES6 classes
Additionally changed folder structure to components and views
2016-11-14 00:18:09 +01:00

27 lines
557 B
JavaScript

import React, { Component, PropTypes } from 'react';
import Tab from './Tab';
class Subtabs extends Component {
static propTypes = {
active: PropTypes.string,
onClick: PropTypes.func,
tabs: PropTypes.array
};
render() {
return (
<div className="subtabs">
{
this.props.tabs.map((tab, index) => {
const { tag, ...other } = tab;
return <Tab key={'subtab-' + index} {...other} active={this.props.active === tag} onClick={this.props.onClick.bind(null, tab.tag)}/>;
})
}
</div>
);
}
}
export default Subtabs;