Code Explainers
function usePagination(items, pageSize = 10) { let currentPage = 1; const totalPages = Math.max(1, Math.ceil(items.length / pageSize));