All Downloads are FREE. Search and download functionalities are using the official Maven repository.

components.snippets.Panel.PanelBody.jsx Maven / Gradle / Ivy

There is a newer version: 7.28.3
Show newest version
import React from 'react'
import PropTypes from 'prop-types'
import { CardBody, TabContent } from 'reactstrap'

/**
 * Компонент тела {@link Panel}
 * @reactProps {string} id - id для контейнера с табами
 * @reactProps {boolean} hasTabs - флаг наличия табов
 * @reactProps {string|number} activeKey - ключ активного таба
 * @reactProps {node} children - вставляемый внутрь PanelBody элемент
 */
export function PanelBody({ id, activeKey, hasTabs, children }) {
    const tabContainer = (
        
            {children}
        
    )
    const element = () => (hasTabs ? tabContainer : children)

    return {element()}
}

PanelBody.propTypes = {
    id: PropTypes.string,
    hasTabs: PropTypes.bool,
    activeKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    children: PropTypes.node,
}

PanelBody.defaultProps = {
    hasTabs: false,
}

export default PanelBody




© 2015 - 2025 Weber Informatics LLC | Privacy Policy