24 lines
592 B
JavaScript
24 lines
592 B
JavaScript
import PropTypes from "prop-types";
|
|
import * as React from "react";
|
|
|
|
export function CustomTabPanel(props) {
|
|
const {children, value, index, ...other} = props;
|
|
|
|
return (
|
|
<div
|
|
role="tabpanel"
|
|
hidden={value !== index}
|
|
id={`simple-tabpanel-${index}`}
|
|
aria-labelledby={`simple-tab-${index}`}
|
|
{...other}
|
|
>
|
|
{value === index && children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
CustomTabPanel.propTypes = {
|
|
children: PropTypes.node,
|
|
index: PropTypes.number.isRequired,
|
|
value: PropTypes.number.isRequired,
|
|
}; |