mirror of
https://github.com/langgenius/dify.git
synced 2026-03-19 17:19:56 +08:00
20 lines
490 B
TypeScript
20 lines
490 B
TypeScript
import { create } from 'zustand'
|
|
import type { App } from '@/types/app'
|
|
|
|
type State = {
|
|
appDetail?: App
|
|
appSidebarExpand: string
|
|
}
|
|
|
|
type Action = {
|
|
setAppDetail: (appDetail?: App) => void
|
|
setAppSiderbarExpand: (state: string) => void
|
|
}
|
|
|
|
export const useStore = create<State & Action>(set => ({
|
|
appDetail: undefined,
|
|
setAppDetail: appDetail => set(() => ({ appDetail })),
|
|
appSidebarExpand: '',
|
|
setAppSiderbarExpand: appSidebarExpand => set(() => ({ appSidebarExpand })),
|
|
}))
|