var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React from 'react';
import PropTypes from 'prop-types';
import styles from './UdpTabPanel.module.css';
export const UdpTabPanel = (props) => {
    const { value, index, //deprecated, use id
    children, keepMounted = true, id } = props, otherProps = __rest(props, ["value", "index", "children", "keepMounted", "id"]);
    const isActive = value === index || value === id;
    // Unmount inactive tabs if keepMounted is false
    if (!keepMounted && !isActive) {
        return null;
    }
    const panelId = id || `tabpanel-${index}`;
    const tabId = `tab-${index}`;
    return (React.createElement("div", Object.assign({ role: "tabpanel", id: panelId, "aria-labelledby": tabId, hidden: !isActive, className: styles.tabPanel }, otherProps), children));
};
UdpTabPanel.propTypes = {
    value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
    index: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
    children: PropTypes.node,
    keepMounted: PropTypes.bool,
    id: PropTypes.string
};
//# sourceMappingURL=UdpTabPanel.js.map