import { breakpointNames } from "../../../components/application/ContainerBreakpoint/breakpoints.js";
import useContainerBreakpoint from '../useContainerBreakpoint';
const breakpointIndex = Object.fromEntries(breakpointNames.map((name, i) => [name, i]));

/**
 * Determine if the current _container_ breakpoint measurement is at least the
 * minimum width of the specified breakpoint.
 *
 * @param {'xxs'|'xs'|'sm'|'md'|'lg'|'xl'|'xxl'} breakpoint
 *   The breakpoint to compare the current measurement to.
 */
function useContainerBreakpointIsAtLeast(breakpoint) {
  const currentBreakpoint = useContainerBreakpoint();
  return breakpointIndex[currentBreakpoint] >= breakpointIndex[breakpoint];
}
export default useContainerBreakpointIsAtLeast;