semantic-ui-react
Version:
The official Semantic-UI-React integration.
31 lines (23 loc) • 834 B
JavaScript
import cx from 'clsx'
import PropTypes from 'prop-types'
import React from 'react'
import { getElementType, getUnhandledProps } from '../../lib'
/**
* Button groups can contain conditionals.
*/
function ButtonOr(props) {
const { className, text } = props
const classes = cx('or', className)
const rest = getUnhandledProps(ButtonOr, props)
const ElementType = getElementType(ButtonOr, props)
return <ElementType {...rest} className={classes} data-text={text} />
}
ButtonOr.propTypes = {
/** An element type to render as (string or function). */
as: PropTypes.elementType,
/** Additional classes. */
className: PropTypes.string,
/** Or buttons can have their text localized, or adjusted by using the text prop. */
text: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
}
export default ButtonOr