"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageBase = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const React = tslib_1.__importStar(require("react"));
const imageContext_1 = require("../../gravity-blocks/context/imageContext/index.js");
exports.ImageBase = React.forwardRef(({ fetchPriority, alt, ...props }, ref) => {
    const { Image } = React.useContext(imageContext_1.ImageContext);
    return Image ? ((0, jsx_runtime_1.jsx)(Image, { fetchPriority: fetchPriority, alt: alt, ...props, ref: ref })) : (
    // There is an issue with fetchpriority attr in img in React.
    // It is still not supported. However it's nice to have ability to manage
    // this prop is good to have to improve Core Web Vitals.
    // So, here is a workaround to assign the attr.
    (0, jsx_runtime_1.jsx)("img", { fetchPriority: fetchPriority, alt: alt, ...props, ref: ref }));
});
exports.ImageBase.displayName = 'ImageBase';
exports.default = exports.ImageBase;
//# sourceMappingURL=ImageBase.js.map
