Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

551 B
Raw Blame
import type { FeaturesState, FeaturesStore } from './store'
import { createContext, useState } from 'react'
import { createFeaturesStore } from './store'

export const FeaturesContext = createContext<FeaturesStore | null>(null)

type FeaturesProviderProps = {
  children: React.ReactNode
} & Partial<FeaturesState>
export const FeaturesProvider = ({ children, ...props }: FeaturesProviderProps) => {
  const [store] = useState(() => createFeaturesStore(props))

  return <FeaturesContext.Provider value={store}>{children}</FeaturesContext.Provider>
}