/** @format */
import * as React from 'react';
import {Tabs} from 'antd';
import {TabsProps} from 'antd/es/tabs';
const {TabPane} = Tabs;

export interface CustomTabPaneProps {
    tabname: string;
    key: undefined | string;
    content: React.ReactNode;
}
export interface CustomTabsProps extends TabsProps {
    dataSource: CustomTabPaneProps[];
}
const CustomeTab: React.FC<CustomTabsProps> = props => {
    const {dataSource, ...rest} = props;
    return (
        <Tabs {...rest} animated={false}>
            {dataSource.map(({content, tabname, key}) => {
                return (
                    <TabPane tab={tabname} key={key}>
                        {content}
                    </TabPane>
                );
            })}
        </Tabs>
    );
};
export default CustomeTab;
