import { Box } from '@mui/material'; import { ReactElement, ReactNode, useMemo } from 'react'; const TabContent = ({ changingTabId, children, retain = false, tabId, }: TabContentProps): ReactElement => { const isTabIdMatch = useMemo( () => changingTabId === tabId, [changingTabId, tabId], ); const result = useMemo( () => retain ? ( {children} ) : ( isTabIdMatch && children ), [children, isTabIdMatch, retain], ); return <>{result}; }; export default TabContent;