@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
20 lines (19 loc) • 710 B
JavaScript
"use client";
import { ConfigContext } from "../ConfigProvider/index.mjs";
import { createElement, memo, use, useMemo } from "react";
import { jsx } from "react/jsx-runtime";
//#region src/Img/index.tsx
const createContainer = (as) => memo((props) => createElement(as, props));
const Img = ({ unoptimized, ...rest }) => {
const config = use(ConfigContext);
const render = config?.imgAs || "img";
const ImgContainer = useMemo(() => createContainer(render), [render]);
return /* @__PURE__ */ jsx(ImgContainer, {
unoptimized: unoptimized === void 0 ? config?.imgUnoptimized : unoptimized,
...rest
});
};
Img.displayName = "Img";
//#endregion
export { Img as default };
//# sourceMappingURL=index.mjs.map