import { useState, useEffect } from 'react';
function useDivideArrayIntoGroups(array, groupCount) {
    const [groups, setGroups] = useState([]);
    useEffect(() => {
        const groupSize = Math.ceil(array.length / groupCount);
        const newGroups = [];
        let startIndex = 0;
        for (let i = 0; i < groupCount; i++) {
            const endIndex = Math.min(startIndex + groupSize, array.length);
            newGroups.push(array.slice(startIndex, endIndex));
            startIndex = endIndex;
        }
        setGroups(newGroups);
    }, [array, groupCount]);
    return groups;
}
export default useDivideArrayIntoGroups;
//# sourceMappingURL=useDivideArrayIntoGroups.js.map