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

interface CurrentComplexState {
  currentComplexSlug: string | null;
  setCurrentComplex: (slug: string | null) => void;
}

export const useCurrentComplexStore = create<CurrentComplexState>()(
  persist(
    (set) => ({
      currentComplexSlug: null,
      setCurrentComplex: (slug) => set({ currentComplexSlug: slug }),
    }),
    {
      name: 'current-complex-slug',
    }
  )
);
