import React from 'react';
import { Tabs } from 'antd';
import './Component.scss';

const { TabPane } = Tabs;

export default (({ nav, index , onChange , children })=>{
  return(
    nav && nav.length > 0 ?
    <Tabs className="tabsStyle" animated={false} activeKey={index} onChange={onChange}>
      {
        nav.map((item,key)=>{
          return(
            <TabPane tab={item} key={`${key}`}>{children}</TabPane>
          )
        })
      }
    </Tabs>:""
  )
})