design-react-kit
Version:
Componenti React per Bootstrap 5
24 lines • 1.28 kB
JavaScript
import React from 'react';
export const ResponsiveImage = ({ alt, testId, proportioned = false, children, ...attributes }) => {
if (children) {
if (proportioned) {
return (React.createElement("div", { className: 'img-responsive-wrapper' },
React.createElement("div", { className: 'img-responsive' },
React.createElement("figure", { className: 'img-wrapper' },
React.createElement("img", { ...attributes, alt: alt, className: 'figure-img img-fluid rounded' }),
children))));
}
else {
return (React.createElement("figure", { className: 'figure img-full w-100 img-responsive-wrapper' },
React.createElement("img", { ...attributes, alt: alt, className: 'figure-img img-fluid rounded' }),
children));
}
}
else {
return (React.createElement("div", { className: 'img-responsive-wrapper', "data-testid": testId },
React.createElement("div", { className: 'img-responsive' },
React.createElement("div", { className: 'img-wrapper' },
React.createElement("img", { ...attributes, alt: alt })))));
}
};
//# sourceMappingURL=ResponsiveImage.js.map