"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Img = void 0;
const react_1 = require("react");
const Img = (props) => {
    const { renderError, onError, ...rest } = props;
    const [error, setError] = (0, react_1.useState)(void 0);
    if (error && renderError)
        return renderError(error, props);
    return (0, react_1.createElement)('img', {
        ...rest,
        onError: (e) => {
            setError(e);
            onError?.(e);
        },
    });
};
exports.Img = Img;
//# sourceMappingURL=index.js.map