UNPKG

semantic-ui-react

Version:
44 lines (35 loc) 952 B
import cx from 'classnames' import React, { PropTypes } from 'react' import { customPropTypes, getElementType, getUnhandledProps, META, } 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._meta = { name: 'ButtonOr', parent: 'Button', type: META.TYPES.ELEMENT, } ButtonOr.propTypes = { /** An element type to render as (string or function). */ as: customPropTypes.as, /** 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