@wener/console
Version:
Base console UI toolkit
24 lines (23 loc) • 645 B
JavaScript
import React, { forwardRef } from "react";
export const Image = /*#__PURE__*/ forwardRef(({ src, ...props }, ref)=>{
// if (useIsNextJS()) {
// return <NextImage src={src} {...props} ref={ref} />;
// }
// maybe nextjs image object
if (src && typeof src === 'object') {
if ('src' in src) {
src = src.src;
} else {
src = src.default.src;
}
}
if (typeof src === 'string') {
return /*#__PURE__*/ React.createElement("img", {
src: src,
...props,
ref: ref
});
}
return null;
});
//# sourceMappingURL=Image.js.map