UNPKG

@progress/kendo-react-common

Version:

React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package

27 lines (26 loc) 1.17 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use client"; import * as e from "react"; import { Icon as g } from "./Icon.mjs"; import { SvgIcon as I } from "./SvgIcon.mjs"; import { IconsContext as l } from "./IconsContext.mjs"; const v = e.forwardRef( (t, c) => { var r, i; const { type: m, icons: o } = e.useContext(l), { icon: s, ...f } = t; let n = m === "svg" ? ((r = t.icon) == null ? void 0 : r.name) || t.name : t.name || ((i = t.icon) == null ? void 0 : i.name); n = n && o && o[n] && typeof o[n] == "string" ? o[n] : n; const a = n && o && o[n] && typeof o[n] != "string" ? o[n] : s; return m === "svg" && a ? /* @__PURE__ */ e.createElement(I, { ...t, icon: a, ref: c }) : /* @__PURE__ */ e.createElement(g, { ...f, name: n, ref: c }); } ); v.displayName = "KendoIconWrap"; export { v as IconWrap };