26 lines
1.1 KiB
JavaScript
26 lines
1.1 KiB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
import classNames from 'classnames';
|
|
import React from 'react';
|
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
var defaultProps = {
|
|
variant: null
|
|
};
|
|
var CardImg = React.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
function (_ref, ref) {
|
|
var bsPrefix = _ref.bsPrefix,
|
|
className = _ref.className,
|
|
variant = _ref.variant,
|
|
_ref$as = _ref.as,
|
|
Component = _ref$as === void 0 ? 'img' : _ref$as,
|
|
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "variant", "as"]);
|
|
|
|
var prefix = useBootstrapPrefix(bsPrefix, 'card-img');
|
|
return React.createElement(Component, _extends({
|
|
ref: ref,
|
|
className: classNames(variant ? prefix + "-" + variant : prefix, className)
|
|
}, props));
|
|
});
|
|
CardImg.displayName = 'CardImg';
|
|
CardImg.defaultProps = defaultProps;
|
|
export default CardImg; |