GoScrobble/web/node_modules/react-bootstrap/esm/Badge.js

28 lines
1.0 KiB
JavaScript
Raw Normal View History

2022-04-25 02:47:15 +00:00
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
var _excluded = ["bsPrefix", "variant", "pill", "className", "as"];
import classNames from 'classnames';
import React from 'react';
import { useBootstrapPrefix } from './ThemeProvider';
var defaultProps = {
pill: false
};
var Badge = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
var bsPrefix = _ref.bsPrefix,
variant = _ref.variant,
pill = _ref.pill,
className = _ref.className,
_ref$as = _ref.as,
Component = _ref$as === void 0 ? 'span' : _ref$as,
props = _objectWithoutPropertiesLoose(_ref, _excluded);
var prefix = useBootstrapPrefix(bsPrefix, 'badge');
return /*#__PURE__*/React.createElement(Component, _extends({
ref: ref
}, props, {
className: classNames(className, prefix, pill && prefix + "-pill", variant && prefix + "-" + variant)
}));
});
Badge.displayName = 'Badge';
Badge.defaultProps = defaultProps;
export default Badge;