mirror of
https://github.com/wassname/talk.git
synced 2026-07-30 12:40:41 +08:00
38 lines
906 B
JavaScript
38 lines
906 B
JavaScript
import React from 'react';
|
|
import {TabBar, TabContent} from 'coral-ui';
|
|
import PropTypes from 'prop-types';
|
|
|
|
class StreamTabPanel extends React.Component {
|
|
|
|
render() {
|
|
const {activeTab, setActiveTab, tabs, tabPanes, sub} = this.props;
|
|
return (
|
|
<div>
|
|
<TabBar activeTab={activeTab} onTabClick={setActiveTab} sub={sub}>
|
|
{tabs}
|
|
</TabBar>
|
|
<TabContent activeTab={activeTab} sub={sub}>
|
|
{tabPanes}
|
|
</TabContent>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
StreamTabPanel.propTypes = {
|
|
activeTab: PropTypes.string.isRequired,
|
|
setActiveTab: PropTypes.func.isRequired,
|
|
tabs: PropTypes.oneOfType([
|
|
PropTypes.element,
|
|
PropTypes.arrayOf(PropTypes.element)
|
|
]),
|
|
tabPanes: PropTypes.oneOfType([
|
|
PropTypes.element,
|
|
PropTypes.arrayOf(PropTypes.element)
|
|
]),
|
|
className: PropTypes.string,
|
|
sub: PropTypes.bool,
|
|
};
|
|
|
|
export default StreamTabPanel;
|