import * as React from 'react';
import { OverlayContext } from './index';
export const useOverlay = () => {
  const {
    setOverlayItem,
    defaultConfig,
    setConfig
  } = React.useContext(OverlayContext);

  const closeOverlay = () => {
    setOverlayItem(null);
  };

  const setOverlay = (component, config) => {
    config && setConfig({ ...defaultConfig,
      ...config
    });
    setOverlayItem(component);
  };

  return {
    closeOverlay,
    setOverlay
  };
};
//# sourceMappingURL=hooks.js.map