mirror of
https://github.com/langgenius/dify.git
synced 2025-10-24 07:28:48 +00:00
16 lines
313 B
TypeScript
16 lines
313 B
TypeScript
|
|
import { create } from 'zustand'
|
||
|
|
import type { Label } from './constant'
|
||
|
|
|
||
|
|
type State = {
|
||
|
|
labelList: Label[]
|
||
|
|
}
|
||
|
|
|
||
|
|
type Action = {
|
||
|
|
setLabelList: (labelList?: Label[]) => void
|
||
|
|
}
|
||
|
|
|
||
|
|
export const useStore = create<State & Action>(set => ({
|
||
|
|
labelList: [],
|
||
|
|
setLabelList: labelList => set(() => ({ labelList })),
|
||
|
|
}))
|