import { create } from 'zustand'

export type ConnectionStatus = 'connected' | 'connecting' | 'disconnected' | 'error'

interface ConnectionState {
  status: ConnectionStatus
  queuedCount: number
  setStatus: (status: ConnectionStatus) => void
  setQueuedCount: (count: number) => void
}

export const useConnectionStore = create<ConnectionState>((set) => ({
  status: 'disconnected',
  queuedCount: 0,
  setStatus: (status) => set({ status }),
  setQueuedCount: (count) => set({ queuedCount: count }),
}))
