39246-vm/frontend/store/settingsStore.ts
abbashkyt-creator 7d8ce0e322 V0.1
2026-03-14 04:02:22 +03:00

16 lines
461 B
TypeScript

import { create } from 'zustand'
interface SettingsState {
config: Record<string, string>
loaded: boolean
setConfig: (config: Record<string, string>) => void
updateKey: (key: string, value: string) => void
}
export const useSettingsStore = create<SettingsState>((set) => ({
config: {},
loaded: false,
setConfig: (config) => set({ config, loaded: true }),
updateKey: (key, value) => set((s) => ({ config: { ...s.config, [key]: value } })),
}))