import { create } from 'zustand'

type SpinnerState = {
  isShow: boolean
  setIsShow: (isShow: boolean) => void
  resetCount: () => void
}

type InitialState = {
  isShow: boolean
}

const initialState: InitialState = {
  isShow: false,
}

export const useSpinnerStore = create<SpinnerState>((set) => ({
  ...initialState,
  setIsShow: (isShow: boolean) => set({ isShow }),
  resetCount: () => set(initialState),
}))
