mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 14:04:50 +00:00
refactor(monorepo): decouple api and webui into workspaces packages
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import type { FieldInfo as FieldInfo } from '@shumai/dtos'
|
||||
import { create } from 'zustand'
|
||||
|
||||
interface FieldState {
|
||||
fields: FieldInfo[]
|
||||
loadedProjectId: string | null
|
||||
setFields: (fields: FieldInfo[], projectId: string) => void
|
||||
updateFields: (fields: FieldInfo[]) => void
|
||||
}
|
||||
|
||||
export const useFieldStore = create<FieldState>((set) => ({
|
||||
fields: [],
|
||||
loadedProjectId: null,
|
||||
setFields: (fields, projectId) =>
|
||||
set({
|
||||
fields,
|
||||
loadedProjectId: projectId,
|
||||
}),
|
||||
updateFields: (fields) => set({ fields }),
|
||||
}))
|
||||
Reference in New Issue
Block a user