var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
/* eslint-disable @typescript-eslint/no-namespace */
import { memo, forwardRef } from "react";
import { tss } from "../theme";
export var GlImage = memo(forwardRef(function (props, ref) {
    var _a = props.hasBorderRadius, hasBorderRadius = _a === void 0 ? true : _a, id = props.id, className = props.className, src = props.src, alt = props.alt, height = props.height, width = props.width, _b = props.hasShadow, hasShadow = _b === void 0 ? true : _b, sources = props.sources, onLoad = props.onLoad;
    var _c = useStyles({
        hasShadow: hasShadow,
        hasBorderRadius: hasBorderRadius,
    }), classes = _c.classes, cx = _c.cx;
    return (_jsxs("picture", { children: [sources !== undefined &&
                sources.map(function (source) { return _jsx("source", __assign({}, source)); }), _jsx("img", { ref: ref, id: id, onLoad: onLoad, className: cx(classes.root, className), src: src, alt: alt, width: width, height: height })] }));
}));
var useStyles = tss
    .withParams()
    .withName({ GlImage: GlImage })
    .create(function (_a) {
    var theme = _a.theme, hasShadow = _a.hasShadow, hasBorderRadius = _a.hasBorderRadius;
    return ({
        "root": {
            "boxShadow": !hasShadow ? undefined : theme.customShadow,
            "borderRadius": !hasBorderRadius ? undefined : theme.borderRadius,
        },
    });
});
//# sourceMappingURL=GlImage.js.map