import { useApi } from './api.mjs';
import { useSubscription } from './subscription.mjs';

/**
 * Returns the list of delivery selection groups available to the buyers. This hook can only be used by extensions in the following
 * extension targets:
 * - purchase.checkout.shipping-option-list.render-before
 * - purchase.checkout.shipping-option-list.render-after
 */
function useDeliverySelectionGroups() {
  const api = useApi();
  return useSubscription(api.deliverySelectionGroups);
}

export { useDeliverySelectionGroups };
