mirror of
https://github.com/langgenius/dify.git
synced 2025-07-26 11:00:27 +00:00
26 lines
805 B
TypeScript
26 lines
805 B
TypeScript
import { createContext } from 'use-context-selector'
|
|
import type { InstalledApp } from '@/models/explore'
|
|
import { noop } from 'lodash-es'
|
|
|
|
type IExplore = {
|
|
controlUpdateInstalledApps: number
|
|
setControlUpdateInstalledApps: (controlUpdateInstalledApps: number) => void
|
|
hasEditPermission: boolean
|
|
installedApps: InstalledApp[]
|
|
setInstalledApps: (installedApps: InstalledApp[]) => void
|
|
isFetchingInstalledApps: boolean
|
|
setIsFetchingInstalledApps: (isFetchingInstalledApps: boolean) => void
|
|
}
|
|
|
|
const ExploreContext = createContext<IExplore>({
|
|
controlUpdateInstalledApps: 0,
|
|
setControlUpdateInstalledApps: noop,
|
|
hasEditPermission: false,
|
|
installedApps: [],
|
|
setInstalledApps: noop,
|
|
isFetchingInstalledApps: false,
|
|
setIsFetchingInstalledApps: noop,
|
|
})
|
|
|
|
export default ExploreContext
|