import { breakpointMins } from "../../../atoms/breakpoint/index.js";
import useBreakpointWidth from '../useBreakpointWidth';

/**
 * Determine if the current breakpoint measurement is at least the minimum
 * width of the specified breakpoint.
 *
 * @param {'xs'|'sm'|'md'|'lg'|'xl'} breakpoint
 *   The breakpoint to compare the current measurement to.
 */
const useBreakpointIsAtLeast = function useBreakpointIsAtLeast(breakpoint, key = 'window') {
  const width = useBreakpointWidth(key);
  const min = breakpointMins[breakpoint];
  return width >= min;
};
export default useBreakpointIsAtLeast;