@onwave/ui
Version:
onwave ui library
16 lines • 827 B
JavaScript
import Image from "next/image";
import React from "react";
import { useBreakPoints } from "../../utils/useBreakPoints";
var RawResponsiveImage = function (_a) {
var src = _a.src, mobileSrc = _a.mobileSrc, tabletSrc = _a.tabletSrc, alt = _a.alt, width = _a.width, height = _a.height;
var _b = useBreakPoints(), isMobile = _b.isMobile, isTablet = _b.isTablet;
if (isMobile && mobileSrc) {
return React.createElement(Image, { src: mobileSrc, alt: alt, width: width, height: height });
}
if (isTablet && tabletSrc) {
return React.createElement(Image, { src: tabletSrc, alt: alt, width: width, height: height });
}
return React.createElement(Image, { src: src, alt: alt, width: width, height: height });
};
export default RawResponsiveImage;
//# sourceMappingURL=RawResponsiveImage.js.map