"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const FallbackImg = ({ src, alt, className, fallback }) => {
    const [isSrcValid, setIsSrcValid] = (0, react_1.useState)(true);
    if (src && isSrcValid) {
        return (0, jsx_runtime_1.jsx)("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
    }
    return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fallback });
};
exports.default = FallbackImg;
