@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 838 B
Source Map (JSON)
{"version":3,"file":"context.mjs","names":[],"sources":["../../../src/dashboard/ConsoleShell/context.ts"],"sourcesContent":["'use client';\n\nimport { createContext, use } from 'react';\n\nimport type { ConsoleShellState } from './type';\n\nexport const ConsoleShellContext = createContext<ConsoleShellState | null>(null);\n\nexport function useConsoleShell(): ConsoleShellState {\n const value = use(ConsoleShellContext);\n if (!value) throw new Error('useConsoleShell must be used within ConsoleShell');\n return value;\n}\n\nexport function useConsoleShellState(): ConsoleShellState | null {\n return use(ConsoleShellContext);\n}\n"],"mappings":";;;AAMA,MAAa,sBAAsB,cAAwC,IAAI;AAE/E,SAAgB,kBAAqC;CACnD,MAAM,QAAQ,IAAI,mBAAmB;CACrC,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,kDAAkD;CAC9E,OAAO;AACT;AAEA,SAAgB,uBAAiD;CAC/D,OAAO,IAAI,mBAAmB;AAChC"}