import { create } from 'zustand';

export interface HydrationState {
  pendingLoad: {
    module: string;
    inputs: Record<string, unknown>;
  } | null;
  setPendingLoad: (module: string, inputs: Record<string, unknown>) => void;
  clearPendingLoad: () => void;
}

export const useHydrationStore = create<HydrationState>((set) => ({
  pendingLoad: null,
  setPendingLoad: (module, inputs) => set({ pendingLoad: { module, inputs } }),
  clearPendingLoad: () => set({ pendingLoad: null }),
}));
