@talend/react-bootstrap
Version:
Bootstrap 3 components built with React
56 lines • 1.35 kB
JavaScript
import classNames from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import { bsClass, prefix, splitBsProps } from './utils/bootstrapUtils';
import { jsx as _jsx } from "react/jsx-runtime";
const propTypes = {
/**
* Sets image as responsive image
*/
responsive: PropTypes.bool,
/**
* Sets image shape as rounded
*/
rounded: PropTypes.bool,
/**
* Sets image shape as circle
*/
circle: PropTypes.bool,
/**
* Sets image shape as thumbnail
*/
thumbnail: PropTypes.bool
};
const defaultProps = {
responsive: false,
rounded: false,
circle: false,
thumbnail: false
};
class Image extends React.Component {
render() {
const {
responsive,
rounded,
circle,
thumbnail,
className,
...props
} = this.props;
const [bsProps, elementProps] = splitBsProps(props);
const classes = {
[]: responsive,
[]: rounded,
[]: circle,
[]: thumbnail
};
return /*#__PURE__*/_jsx("img", {
...elementProps,
className: classNames(className, classes)
});
}
}
Image.propTypes = propTypes;
Image.defaultProps = defaultProps;
export default bsClass('img', Image);
//# sourceMappingURL=Image.js.map