import React, { PropsWithChildren, useMemo } from 'react'; import { RuntimeContextType } from './types'; const IconRuntimeContext = React.createContext({ packs: new Map() }); export function RuntimeProvider({ children, packs }: PropsWithChildren>) { return ( ({ packs }), [packs] )} > {children} ); } export function useIconRuntime() { const context = React.useContext(IconRuntimeContext); if (context === undefined) { throw new Error('useIconRuntime must be used within a RuntimeProvider'); } return context; }