import { useState, useCallback } from 'react';

/**
 * Tracks whether the Buy Box carousel has been scrolled at least once.
 * Once scrolled, the left arrow becomes permanently visible,
 * since the carousel loops and "going back" is always possible.
 */
export const useBuyBoxScrollState = () => {
  const [hasScrolled, setHasScrolled] = useState(false);

  const markScrolled = useCallback(() => {
    setHasScrolled(true);
  }, []);

  return { hasScrolled, markScrolled };
};
