import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { useState } from 'react';
const FallbackImg = ({ src, alt, className, fallback }) => {
    const [isSrcValid, setIsSrcValid] = useState(true);
    if (src && isSrcValid) {
        return _jsx("img", { className: className, src: src, alt: alt, onError: () => setIsSrcValid(false) });
    }
    return _jsx(_Fragment, { children: fallback });
};
export default FallbackImg;
