import React from 'react';
import TabOne from '@commonComp/Tab/TabOne';
import styles from './index.less'
import PropTypes from "prop-types"

class RightPart extends React.Component {
    constructor(props) {
        super(props)
    }
    render() {
        let { tabs, activeId, children ,handleActiveClick} = this.props;
        return (
            <div className={styles['clearfix']} >
                <div className={`${styles['tabTop']} ${styles['clearfix']}`}>
                    {
                        tabs && tabs.map((value, idx) => {
                            return <TabOne
                                isSelect={activeId == idx}
                                title={value.title}
                                id={idx}
                                handleClick={handleActiveClick}
                            ></TabOne>
                        })
                    }
                </div>
                {children}
            </div>
        )
    }
}

RightPart.defaultProps = {
    activeId: '0'
};

RightPart.propTypes = {
    tabs:PropTypes.array.isRequired,
    activeId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
    handleClick: PropTypes.func
};


export default RightPart;