semantic-ui-react
Version:
The official Semantic-UI-React integration.
42 lines (33 loc) • 944 B
JavaScript
import cx from 'classnames'
import PropTypes from 'prop-types'
import React from 'react'
import {
customPropTypes,
getElementType,
getUnhandledProps,
META,
} from '../../lib'
/**
* Header content wraps the main content when there is an adjacent Icon or Image.
*/
function HeaderContent(props) {
const { children, className } = props
const classes = cx('content', className)
const rest = getUnhandledProps(HeaderContent, props)
const ElementType = getElementType(HeaderContent, props)
return <ElementType {...rest} className={classes}>{children}</ElementType>
}
HeaderContent._meta = {
name: 'HeaderContent',
parent: 'Header',
type: META.TYPES.VIEW,
}
HeaderContent.propTypes = {
/** An element type to render as (string or function). */
as: customPropTypes.as,
/** Primary content. */
children: PropTypes.node,
/** Additional classes. */
className: PropTypes.string,
}
export default HeaderContent