import { create } from "zustand";
import { devtools } from "zustand/middleware";

interface ModalState {
  modal: JSX.Element | null;
  setModal: (modal: JSX.Element | null) => void;
}

const useModalStore = create<ModalState>()(
  devtools((set) => ({
    modal: null,
    setModal: (modal) => set({ modal }),
  }))
);

export default useModalStore;
