Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
TabPanel.jsx44 linesDownload Raw Back to components
1/////////////////////////////////////////////////////////////2//3// pgAdmin 4 - PostgreSQL Tools4//5// Copyright (C) 2013 - 2024, The pgAdmin Development Team6// This software is released under the PostgreSQL Licence7//8//////////////////////////////////////////////////////////////9 10import React from 'react';11import { Box } from '@mui/material';12import { makeStyles } from '@mui/styles';13import clsx from 'clsx';14import PropTypes from 'prop-types';15import CustomPropTypes from '../custom_prop_types';16 17export const tabPanelStyles = makeStyles((theme)=>({18  root: {19    ...theme.mixins.tabPanel,20  },21  content: {22    height: '100%',23  }24}));25 26/* Material UI does not have any tabpanel component, we create one for us */27export default function TabPanel({children, classNameRoot, className, value, index, ...props}) {28  const classes = tabPanelStyles();29  const active = value === index;30  return (31    <Box className={clsx(classes.root, classNameRoot)} component="div" hidden={!active} data-test="tabpanel" {...props}>32      <Box className={clsx(classes.content, className)}>{children}</Box>33    </Box>34  );35}36 37TabPanel.propTypes = {38  children: CustomPropTypes.children,39  classNameRoot: CustomPropTypes.className,40  className: CustomPropTypes.className,41  value: PropTypes.any.isRequired,42  index: PropTypes.any.isRequired,43};44 
codekingpro/portable-devtools · Team Ai