2018-08-02 19:17:40 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
2018-04-18 19:06:41 +00:00
|
|
|
class Tab extends React.Component {
|
2018-08-02 19:17:40 +00:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
this.props.selectedTab === this.props.id && <div id={this.props.id}>
|
|
|
|
{this.props.children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Tab.propTypes = {
|
|
|
|
selectedTab: PropTypes.string,
|
|
|
|
id: PropTypes.string,
|
|
|
|
children: PropTypes.element
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Tab;
|