import { u as useResponsiveSizing } from './useResponsiveSizing-es.js';
import { u as useDataListContext } from './DataListContext-es.js';

function useActiveLayout() {
    const { layoutBreakpoints, layouts } = useDataListContext();
    const breakpoints = useResponsiveSizing();
    const reversedLayoutBreakpoints = [...layoutBreakpoints].reverse();
    const activeBreakpoint = reversedLayoutBreakpoints.find(key => breakpoints[key]) ||
        layoutBreakpoints[0];
    const layout = layouts[activeBreakpoint];
    return { layout, activeBreakpoint };
}

export { useActiveLayout as u };
