mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 04:59:23 +08:00
15 lines
359 B
TypeScript
15 lines
359 B
TypeScript
'use client'
|
|
|
|
import type { IWorkspace } from '@/models/common'
|
|
import { createContext, useContext } from 'use-context-selector'
|
|
|
|
type WorkspacesContextValue = {
|
|
workspaces: IWorkspace[]
|
|
}
|
|
|
|
export const WorkspacesContext = createContext<WorkspacesContextValue>({
|
|
workspaces: [],
|
|
})
|
|
|
|
export const useWorkspacesContext = () => useContext(WorkspacesContext)
|