semantic-ui-react
Version:
The official Semantic-UI-React integration.
46 lines (36 loc) • 1.03 kB
JavaScript
import _ from 'lodash'
import cx from 'classnames'
import React, { PropTypes } from 'react'
import {
customPropTypes,
getElementType,
getUnhandledProps,
META,
} from '../../lib'
function StepDescription(props) {
const { children, className, description } = props
const classes = cx('description', className)
const rest = getUnhandledProps(StepDescription, props)
const ElementType = getElementType(StepDescription, props)
return (
<ElementType {...rest} className={classes}>
{_.isNil(children) ? description : children}
</ElementType>
)
}
StepDescription._meta = {
name: 'StepDescription',
parent: 'Step',
type: META.TYPES.ELEMENT,
}
StepDescription.propTypes = {
/** An element type to render as (string or function). */
as: customPropTypes.as,
/** Additional classes. */
className: PropTypes.string,
/** Primary content. */
children: PropTypes.node,
/** Shorthand for primary content. */
description: customPropTypes.contentShorthand,
}
export default StepDescription