import { create } from "zustand";
import type { ReactNode } from "react";

interface PopupState {
  popup: ReactNode | null;
  setPopup: (popup: ReactNode | null) => void;
  position: { x: number; y: number };
  setPosition: (position: { x: number; y: number }) => void;
}

const usePopupStore = create<PopupState>()((set) => ({
  popup: null,
  position: { x: 0, y: 0 },
  setPosition: (position) => set({ position }),
  setPopup: (popup) => set({ popup }),
}));

export default usePopupStore;
