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 } })),
}))
