Local modifications to ClusterLabs/Anvil by Alteeve
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { Box } from '@mui/material';
|
|
|
|
import { ReactElement, useMemo } from 'react';
|
|
|
|
|
|
|
|
const TabContent = <T,>({
|
|
|
|
changingTabId,
|
|
|
|
children,
|
|
|
|
tabId,
|
|
|
|
}: TabContentProps<T>): ReactElement => {
|
|
|
|
const isTabIdMatch = useMemo(
|
|
|
|
() => changingTabId === tabId,
|
|
|
|
[changingTabId, tabId],
|
|
|
|
);
|
|
|
|
const displayValue = useMemo(
|
|
|
|
() => (isTabIdMatch ? 'initial' : 'none'),
|
|
|
|
[isTabIdMatch],
|
|
|
|
);
|
|
|
|
|
|
|
|
return <Box sx={{ display: displayValue }}>{children}</Box>;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default TabContent;
|