@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 1.12 kB
Source Map (JSON)
{"version":3,"file":"StreamdownProfilerProvider.mjs","names":[],"sources":["../../../src/Markdown/streamProfiler/StreamdownProfilerProvider.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, memo, type PropsWithChildren, use } from 'react';\n\nimport { type StreamdownProfiler } from './profiler';\n\nconst StreamdownProfilerContext = createContext<StreamdownProfiler | null>(null);\n\nexport interface StreamdownProfilerProviderProps {\n profiler?: StreamdownProfiler | null;\n}\n\nexport const StreamdownProfilerProvider = memo<PropsWithChildren<StreamdownProfilerProviderProps>>(\n ({ children, profiler = null }) => {\n return <StreamdownProfilerContext value={profiler}>{children}</StreamdownProfilerContext>;\n },\n);\n\nStreamdownProfilerProvider.displayName = 'StreamdownProfilerProvider';\n\nexport const useStreamdownProfiler = () => {\n return use(StreamdownProfilerContext);\n};\n"],"mappings":";;;;AAMA,MAAM,4BAA4B,cAAyC,KAAK;AAMhF,MAAa,6BAA6B,MACvC,EAAE,UAAU,WAAW,WAAW;AACjC,QAAO,oBAAC,2BAAD;EAA2B,OAAO;EAAW;EAAqC,CAAA;EAE5F;AAED,2BAA2B,cAAc;AAEzC,MAAa,8BAA8B;AACzC,QAAO,IAAI,0BAA0B"}