import { createElement, useState } from 'react';
export const Img = (props) => {
    const { renderError, onError, ...rest } = props;
    const [error, setError] = useState(void 0);
    if (error && renderError)
        return renderError(error, props);
    return createElement('img', {
        ...rest,
        onError: (e) => {
            setError(e);
            onError?.(e);
        },
    });
};
//# sourceMappingURL=index.js.map