mirror of
https://github.com/langgenius/dify.git
synced 2026-03-15 14:20:34 +08:00
21 lines
509 B
TypeScript
21 lines
509 B
TypeScript
import { create } from 'zustand'
|
|
|
|
type State = {
|
|
mode: string
|
|
showRunHistory: boolean
|
|
showFeatures: boolean
|
|
}
|
|
|
|
type Action = {
|
|
setShowRunHistory: (showRunHistory: boolean) => void
|
|
setShowFeatures: (showFeatures: boolean) => void
|
|
}
|
|
|
|
export const useStore = create<State & Action>(set => ({
|
|
mode: 'workflow',
|
|
showRunHistory: false,
|
|
setShowRunHistory: showRunHistory => set(() => ({ showRunHistory })),
|
|
showFeatures: false,
|
|
setShowFeatures: showFeatures => set(() => ({ showFeatures })),
|
|
}))
|