semantic-ui-react
Version:
The official Semantic-UI-React integration.
38 lines (29 loc) • 945 B
JavaScript
import cx from 'clsx'
import PropTypes from 'prop-types'
import React from 'react'
import { childrenUtils, customPropTypes, getElementType, getUnhandledProps } from '../../lib'
/**
* An event or an event summary can contain a date.
*/
function FeedDate(props) {
const { children, className, content } = props
const classes = cx('date', className)
const rest = getUnhandledProps(FeedDate, props)
const ElementType = getElementType(FeedDate, props)
return (
<ElementType {...rest} className={classes}>
{childrenUtils.isNil(children) ? content : children}
</ElementType>
)
}
FeedDate.propTypes = {
/** An element type to render as (string or function). */
as: PropTypes.elementType,
/** Primary content. */
children: PropTypes.node,
/** Additional classes. */
className: PropTypes.string,
/** Shorthand for primary content. */
content: customPropTypes.contentShorthand,
}
export default FeedDate