@krowdy-ui/core
Version:
React components that implement Google's Material Design.
28 lines (25 loc) • 1.05 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["index", "value", "children"];
import React from 'react';
import PropTypes from 'prop-types';
import Typography from '../Typography';
var TabPanel = function TabPanel(_ref) {
var index = _ref.index,
value = _ref.value,
children = _ref.children,
other = _objectWithoutProperties(_ref, _excluded);
return /*#__PURE__*/React.createElement(Typography, _extends({
"aria-labelledby": "wrapped-tab-".concat(index),
component: "div",
hidden: value !== index,
id: "wrapped-tabpanel-".concat(index),
role: "tabpanel"
}, other), value === index && children);
};
process.env.NODE_ENV !== "production" ? TabPanel.propTypes = {
children: PropTypes.node,
index: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
} : void 0;
export default TabPanel;