import React, { useMemo } from 'react'; import Tabs from 'antd/es/tabs'; import 'antd/es/tabs/style/index'; import { XuiTabsProps } from './xui-tabs.d'; const XuiTabs: React.FC = ({ title, tabNav, tabPanes }) => { const className = 'xui-ant__tabs'; const renderTabPanes = useMemo( () => tabPanes.map(tabPane => {tabPane.children}), [tabPanes], ); const { tabBarExtraContent } = tabNav; return (
{title}
, right: tabBarExtraContent, } : tabBarExtraContent } > {renderTabPanes} ); }; export default XuiTabs;