@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 851 B
Source Map (JSON)
{"version":3,"file":"IconProvider.mjs","names":[],"sources":["../../../src/Icon/components/IconProvider.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, createContext, memo, use } from 'react';\n\nimport type { IconProps } from '../type';\n\nexport type IconContentConfig = Omit<IconProps, 'icon' | 'ref'>;\n\nexport const IconContext = createContext<IconContentConfig>({});\n\nexport const IconProvider = memo<{ children: ReactNode; config?: IconContentConfig }>(\n ({ children, config = {} }) => {\n return <IconContext value={config}>{children}</IconContext>;\n },\n);\n\nexport const useIconContext = () => {\n return use(IconContext);\n};\n"],"mappings":";;;;;;AAQA,MAAa,cAAc,cAAiC,EAAE,CAAC;AAE/D,MAAa,eAAe,MACzB,EAAE,UAAU,SAAS,EAAE,OAAO;AAC7B,QAAO,oBAAC;EAAY,OAAO;EAAS;GAAuB;EAE9D;AAED,MAAa,uBAAuB;AAClC,QAAO,IAAI,YAAY"}