import { create } from 'zustand';
import { persist } from 'zustand/middleware';

interface MockState {
  enabled: boolean;
  toggle: () => void;
  set: (v: boolean) => void;
}

export const useMockStore = create<MockState>()(
  persist(
    (set) => ({
      enabled: false,
      toggle: () => set((s) => ({ enabled: !s.enabled })),
      set: (v: boolean) => set({ enabled: v }),
    }),
    { name: 'tapper-mock' },
  ),
);
