import clsx from 'clsx'; import React from 'react'; import { MessageTabButton } from '../MessageTabButton'; import { NavigationBar } from '../NavigationBar'; import { TabTitle } from './TabTitle'; import styles from './styles.scss'; type TabContentPanelProps = { showTabs?: boolean; tabs: { path: string; label: string; isActive: (...args: any[]) => any; dataSign: string; }[]; goTo: (...args: any[]) => any; navClassName?: string; tabContentClassName?: string; tooltipForceHide?: boolean; }; const TabContentPanel: React.FC = ({ showTabs, navClassName, tabContentClassName, tabs, goTo, tooltipForceHide, children, }) => { const renderChildren = () => { if (typeof children === 'function') { return children({ showTabs }); } return children; }; if (!showTabs) { return renderChildren(); } const formattedTabs = tabs.map((tab) => ({ icon: ( ), label: tab.label, path: tab.path, isActive: tab.isActive, })); return (
{renderChildren()}
); }; TabContentPanel.defaultProps = { showTabs: false, }; export default TabContentPanel;