"use client";
import * as React from "react";
import { useStableCallback } from "../../../utils/esm/useStableCallback.js";
import { useEnhancedClickHandler } from "../../../utils/esm/useEnhancedClickHandler.js";
function useOpenInteractionType(open) {
  const [openMethod, setOpenMethod] = React.useState(null);
  const handleTriggerClick = useStableCallback((_, interactionType) => {
    if (!open) {
      setOpenMethod(interactionType);
    }
  });
  const reset = React.useCallback(() => {
    setOpenMethod(null);
  }, []);
  const {
    onClick,
    onPointerDown
  } = useEnhancedClickHandler(handleTriggerClick);
  return React.useMemo(() => ({
    openMethod,
    reset,
    triggerProps: {
      onClick,
      onPointerDown
    }
  }), [openMethod, reset, onClick, onPointerDown]);
}
export {
  useOpenInteractionType
};
//# sourceMappingURL=useOpenInteractionType.js.map
